Module: Census::User::ClassMethods
- Defined in:
- lib/census/user.rb
Instance Method Summary collapse
-
#expose_census_data(group, data, attribute) ⇒ Object
Expose a census data value as an attribute on the model class.
Instance Method Details
#expose_census_data(group, data, attribute) ⇒ Object
Expose a census data value as an attribute on the model class
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/census/user.rb', line 93 def expose_census_data(group, data, attribute) instance_eval do define_method attribute.to_s do self.census_data[group.to_s][data.to_s] end define_method "#{attribute.to_s}=" do |value| self.census_data[group.to_s][data.to_s] = value end end end |