Class: Shale::Mapping::DictGroup Private
- Defined in:
- lib/shale/mapping/dict_group.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Group for dictionary serialization formats (Hash/JSON/YAML/TOML/CSV)
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
private
Return name of the group.
Attributes inherited from DictBase
Instance Method Summary collapse
-
#initialize(from, to) ⇒ DictGroup
constructor
private
Initialize instance.
-
#map(key) ⇒ Object
private
Map key to attribute.
Methods inherited from DictBase
#finalize!, #finalized?, #initialize_dup, #properties
Constructor Details
#initialize(from, to) ⇒ DictGroup
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize instance
24 25 26 27 28 29 |
# File 'lib/shale/mapping/dict_group.rb', line 24 def initialize(from, to) super() @from = from @to = to @name = "group_#{hash}" end |
Instance Attribute Details
#name ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return name of the group
16 17 18 |
# File 'lib/shale/mapping/dict_group.rb', line 16 def name @name end |
Instance Method Details
#map(key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Map key to attribute
36 37 38 |
# File 'lib/shale/mapping/dict_group.rb', line 36 def map(key) super(key, using: { from: @from, to: @to }, group: @name) end |