Class: Shale::Mapping::Group::Xml Private
- Defined in:
- lib/shale/mapping/group/xml.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.
Xml group descriptor
Instance Attribute Summary
Attributes inherited from DictBase
Instance Method Summary collapse
-
#add(kind, key, value) ⇒ Object
private
Add key-value pair to a group.
-
#initialize(method_from, method_to) ⇒ Xml
constructor
private
Initialize instance.
Methods inherited from Dict
Methods inherited from DictBase
#finalize!, #finalized?, #initialize_dup, #map, #properties
Constructor Details
#initialize(method_from, method_to) ⇒ Xml
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
18 19 20 21 |
# File 'lib/shale/mapping/group/xml.rb', line 18 def initialize(method_from, method_to) super(method_from, method_to) @dict = { content: nil, attributes: {}, elements: {} } end |
Instance Method Details
#add(kind, key, value) ⇒ 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.
Add key-value pair to a group
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/shale/mapping/group/xml.rb', line 30 def add(kind, key, value) case kind when :content @dict[:content] = value when :attribute @dict[:attributes][key] = value when :element @dict[:elements][key] = value end end |