Module: BitmaskAttribute::ClassMethods
- Defined in:
- lib/bitmask_attribute.rb
Instance Method Summary collapse
- #bitmask(attribute, options = {}, &extension) ⇒ Object
- #bitmask_definitions ⇒ Object
- #bitmasks ⇒ Object
Instance Method Details
#bitmask(attribute, options = {}, &extension) ⇒ Object
136 137 138 139 140 141 142 |
# File 'lib/bitmask_attribute.rb', line 136 def bitmask(attribute, ={}, &extension) unless [:as] && [:as].kind_of?(Array) raise ArgumentError, "Must provide an Array :as option" end bitmask_definitions[attribute] = BitmaskAttribute::Definition.new(attribute, [:as].to_a, &extension) bitmask_definitions[attribute].install_on(self) end |
#bitmask_definitions ⇒ Object
144 145 146 |
# File 'lib/bitmask_attribute.rb', line 144 def bitmask_definitions @bitmask_definitions ||= {} end |
#bitmasks ⇒ Object
148 149 150 |
# File 'lib/bitmask_attribute.rb', line 148 def bitmasks @bitmasks ||= {} end |