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
141 142 143 144 145 146 147 |
# File 'lib/bitmask_attribute.rb', line 141 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
149 150 151 |
# File 'lib/bitmask_attribute.rb', line 149 def bitmask_definitions @bitmask_definitions ||= {} end |
#bitmasks ⇒ Object
153 154 155 |
# File 'lib/bitmask_attribute.rb', line 153 def bitmasks @bitmasks ||= {} end |