Module: AbstractMapper::Attributes
- Included in:
- Node
- Defined in:
- lib/abstract_mapper/attributes.rb
Overview
Defines attributes along with the DSL for setting them
Defined Under Namespace
Modules: DSL
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
readonly
The initialized attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Object
Initializes the instance with the hash of attributes.
Instance Attribute Details
#attributes ⇒ Hash (readonly)
Returns The initialized attributes.
18 19 20 |
# File 'lib/abstract_mapper/attributes.rb', line 18 def attributes @attributes end |
Class Method Details
.included(klass) ⇒ Object
10 11 12 |
# File 'lib/abstract_mapper/attributes.rb', line 10 def self.included(klass) klass.__send__ :extend, DSL end |
Instance Method Details
#initialize(attributes) ⇒ Object
Initializes the instance with the hash of attributes
24 25 26 |
# File 'lib/abstract_mapper/attributes.rb', line 24 def initialize(attributes) @attributes = Functions[:restrict, self.class.attributes][attributes] end |