barsoom / attr_extras

Takes some boilerplate out of Ruby with methods like attr_initialize.
MIT License
560 stars 31 forks source link

Invalid instance variable names with hash keys #27

Closed henrik closed 5 years ago

henrik commented 5 years ago

I get this:

gems/attr_extras-6.1.0/lib/attr_extras/attr_initialize.rb:36:in `instance_variable_set': `@hammer_absentee_max_bid.minimum_amount' is not allowed as an instance variable name (NameError)

Plan on looking at it after this lunch break :) Also to track down what in our code causes it exactly.

One idea for fix would be to not use ivars directly but instead a hash, e.g. set @foo["hammer_absentee_max_bid.minimum_amount"].

cc @lesin