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
116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/census/user.rb', line 116 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 |