Ruby - File IOWhat does the Ruby method Dir.pwd return?AThe current working directory pathBThe parent directory pathCThe root directory pathDThe home directory pathCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand Dir.pwd purposeDir.pwd returns the path of the current working directory where the Ruby script runs. It does not return parent, root, or home directory paths.Final Answer:The current working directory path -> Option AQuick Check:Dir.pwd = current directory path [OK]Quick Trick: Dir.pwd always shows where your script runs [OK]Common Mistakes:Confusing with Dir.homeAssuming it returns root directoryThinking it returns parent directory
Master "File IO" in Ruby9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Ruby Quizzes Blocks, Procs, and Lambdas - Block parameters - Quiz 11easy Class Methods and Variables - Class variables (@@) and their dangers - Quiz 13medium Class Methods and Variables - Class methods with self prefix - Quiz 11easy Classes and Objects - Self keyword behavior - Quiz 3easy Classes and Objects - Instance methods - Quiz 10hard File IO - IO modes (r, w, a) - Quiz 6medium Inheritance - Subclass with < operator - Quiz 2easy Inheritance - Is_a? and kind_of? for type checking - Quiz 6medium Modules and Mixins - Comparable module usage - Quiz 6medium Modules and Mixins - Prepend for method chain insertion - Quiz 10hard