Class: BitmaskAttribute::ValueProxy
- Defined in:
- lib/bitmask_attribute/value_proxy.rb
Instance Method Summary collapse
-
#initialize(record, attribute, &extension) ⇒ ValueProxy
constructor
A new instance of ValueProxy.
- #to_i ⇒ Object
Constructor Details
#initialize(record, attribute, &extension) ⇒ ValueProxy
Returns a new instance of ValueProxy.
5 6 7 8 9 10 11 |
# File 'lib/bitmask_attribute/value_proxy.rb', line 5 def initialize(record, attribute, &extension) @record = record @attribute = attribute find_mapping instance_eval(&extension) if extension super(extract_values) end |
Instance Method Details
#to_i ⇒ Object
27 28 29 |
# File 'lib/bitmask_attribute/value_proxy.rb', line 27 def to_i inject(0) { |memo, value| memo | @mapping[value] } end |