Class: LolSoap::HashBuilder
- Inherits:
-
Object
- Object
- LolSoap::HashBuilder
- Defined in:
- lib/lolsoap/hash_builder.rb
Overview
Turns an XML node into a hash data structure. Works out which elements are supposed to be collections based on the type information.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(node, type) ⇒ HashBuilder
constructor
A new instance of HashBuilder.
- #output ⇒ Object
Constructor Details
#initialize(node, type) ⇒ HashBuilder
Returns a new instance of HashBuilder.
7 8 9 10 |
# File 'lib/lolsoap/hash_builder.rb', line 7 def initialize(node, type) @node = node @type = type end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
5 6 7 |
# File 'lib/lolsoap/hash_builder.rb', line 5 def node @node end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/lolsoap/hash_builder.rb', line 5 def type @type end |
Instance Method Details
#output ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lolsoap/hash_builder.rb', line 12 def output if node.first_element_child children_hash else content end end |