My Code
def property_values_list
property_values = {"ceremonial"=>249, "party"=>250, "wedding"=>251, "casual"=>252}
end
$property_values = property_values_list()
class Design
attr_reader :occasion_ids
def occasion_ids=(property_name)
self.occasion_ids = []
self.occasion_ids << $property_values[property_name]
end
end
d = Design.new
d.occasion_ids = 'party'
Error
SystemStackError: stack level too deep from .rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/irb/workspace.rb:80 Maybe IRB bug!
occasio_ids=method and try to avoid using global variables. - taro