Module: LogicalModel::Attributes::ClassMethods
- Defined in:
- lib/logical_model/attributes.rb
Instance Method Summary collapse
-
#attribute(name) ⇒ Object
declares an attribute.
- #attribute_keys ⇒ Object
-
#attribute_keys=(keys) ⇒ Object
overrides attributes with given keys.
Instance Method Details
#attribute(name) ⇒ Object
declares an attribute.
39 40 41 42 43 |
# File 'lib/logical_model/attributes.rb', line 39 def attribute(name) @attribute_keys = [] if @attribute_keys.nil? @attribute_keys << name attr_accessor name end |
#attribute_keys ⇒ Object
52 53 54 |
# File 'lib/logical_model/attributes.rb', line 52 def attribute_keys @attribute_keys end |
#attribute_keys=(keys) ⇒ Object
overrides attributes with given keys.
47 48 49 50 |
# File 'lib/logical_model/attributes.rb', line 47 def attribute_keys=(keys) @attribute_keys = keys attr_accessor *keys end |