I would like to put a large variable definition in a separate file for the sake of getting it out of the way. I must be doing something wrong though, because my puts
call isn't putting anything out.
my_class.rb:
class foobar
def initialize
require 'datafile.rb'
puts @fat_data
end
end
datafile.rb:
@fat_data = [1,2,3,4,5,6,7,8,9,10]
Can you use require this way?