Class: Soap::Parser::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/soap/parser/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_namespaces, node) ⇒ Message

Returns a new instance of Message.



10
11
12
13
# File 'lib/soap/parser/message.rb', line 10

def initialize(_namespaces, node)
  @node = node
  @hash = {}
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



7
8
9
# File 'lib/soap/parser/message.rb', line 7

def hash
  @hash
end

#nodeObject (readonly)

Returns the value of attribute node.



8
9
10
# File 'lib/soap/parser/message.rb', line 8

def node
  @node
end

Instance Method Details

#parseObject



15
16
17
# File 'lib/soap/parser/message.rb', line 15

def parse
  parse_message
end

#parse_messageObject



19
20
21
22
23
24
25
26
# File 'lib/soap/parser/message.rb', line 19

def parse_message
  @hash = Hash[@node.map do |node|
    [node["name"], Hash[:part, Hash[node.element_children.map do |mec|
      [mec["name"], mec.attribute("element").value]
    end
    ]]]
  end]
end