Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To retrieve a variable that has been specified in a Ruby file that has been required in IRB, you can simply call the variable name in IRB. For example, if you have required a file called "example.rb" that defines a variable called "my_variable", you can retrieve it in IRB by typing:

require './example.rb'
my_variable

This will output the value of the variable in the IRB console.