Class: DeltaCore::Mapping
- Inherits:
-
Object
- Object
- DeltaCore::Mapping
- Defined in:
- lib/delta_core/mapping.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#relations ⇒ Object
readonly
Returns the value of attribute relations.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(name, key:, strategy:, fields: [], relations: {}) ⇒ Mapping
constructor
A new instance of Mapping.
Constructor Details
#initialize(name, key:, strategy:, fields: [], relations: {}) ⇒ Mapping
Returns a new instance of Mapping.
7 8 9 10 11 12 13 |
# File 'lib/delta_core/mapping.rb', line 7 def initialize(name, key:, strategy:, fields: [], relations: {}) @name = name.to_sym @key = key.to_sym @fields = Array(fields).map(&:to_sym) @strategy = strategy.to_sym @relations = build_relations(relations || {}) end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
5 6 7 |
# File 'lib/delta_core/mapping.rb', line 5 def fields @fields end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/delta_core/mapping.rb', line 5 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/delta_core/mapping.rb', line 5 def name @name end |
#relations ⇒ Object (readonly)
Returns the value of attribute relations.
5 6 7 |
# File 'lib/delta_core/mapping.rb', line 5 def relations @relations end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
5 6 7 |
# File 'lib/delta_core/mapping.rb', line 5 def strategy @strategy end |