Bird
0
0

What is the output when you run IRB with this ~/.irbrc content?

medium📝 Predict Output Q5 of 15
Ruby - Ecosystem and Best Practices
What is the output when you run IRB with this ~/.irbrc content?
IRB.conf[:AUTO_INDENT] = true
puts IRB.conf[:AUTO_INDENT]
Atrue
Bfalse
Cnil
DAn error is raised
Step-by-Step Solution
Solution:
  1. Step 1: Understand the setting and output

    Setting IRB.conf[:AUTO_INDENT] to true enables auto-indent.
  2. Step 2: The puts prints the current value

    Since it was set to true, puts outputs "true".
  3. Final Answer:

    true -> Option A
  4. Quick Check:

    Setting and printing IRB.conf value outputs set value [OK]
Quick Trick: Print IRB.conf[:key] to check current setting [OK]
Common Mistakes:
  • Expecting false or nil output
  • Thinking IRB.conf keys are strings
  • Assuming puts causes error here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes