Class: BitmaskAttribute::Definition
- Inherits:
-
Object
- Object
- BitmaskAttribute::Definition
- Defined in:
- lib/bitmask_attribute.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(attribute, values = [], &extension) ⇒ Definition
constructor
A new instance of Definition.
- #install_on(model) ⇒ Object
Constructor Details
#initialize(attribute, values = [], &extension) ⇒ Definition
Returns a new instance of Definition.
8 9 10 11 12 |
# File 'lib/bitmask_attribute.rb', line 8 def initialize(attribute, values=[], &extension) @attribute = attribute @values = values @extension = extension end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
7 8 9 |
# File 'lib/bitmask_attribute.rb', line 7 def attribute @attribute end |
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
7 8 9 |
# File 'lib/bitmask_attribute.rb', line 7 def extension @extension end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
7 8 9 |
# File 'lib/bitmask_attribute.rb', line 7 def values @values end |
Instance Method Details
#install_on(model) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/bitmask_attribute.rb', line 14 def install_on(model) validate_for model generate_bitmasks_on model override model create_convenience_class_method_on(model) create_convenience_instance_methods_on(model) create_named_scopes_on(model) end |