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
82 83 84 85 86 87 88 |
# File 'lib/bitmask_attribute.rb', line 82 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
90 91 92 |
# File 'lib/bitmask_attribute.rb', line 90 def bitmask_definitions @bitmask_definitions ||= {} end |
#bitmasks ⇒ Object
94 95 96 |
# File 'lib/bitmask_attribute.rb', line 94 def bitmasks @bitmasks ||= {} end |