Class: Soap::Parser::PortType
- Inherits:
-
Object
- Object
- Soap::Parser::PortType
- Defined in:
- lib/soap/parser/port_type.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(_namespaces, node) ⇒ PortType
constructor
A new instance of PortType.
- #parse ⇒ Object
- #parse_input_or_output(node, type) ⇒ Object
- #parse_port_types ⇒ Object
Constructor Details
#initialize(_namespaces, node) ⇒ PortType
Returns a new instance of PortType.
10 11 12 13 |
# File 'lib/soap/parser/port_type.rb', line 10 def initialize(_namespaces, node) @node = node @hash = {} end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
7 8 9 |
# File 'lib/soap/parser/port_type.rb', line 7 def hash @hash end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
8 9 10 |
# File 'lib/soap/parser/port_type.rb', line 8 def node @node end |
Instance Method Details
#parse ⇒ Object
15 16 17 |
# File 'lib/soap/parser/port_type.rb', line 15 def parse parse_port_types end |
#parse_input_or_output(node, type) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/soap/parser/port_type.rb', line 34 def parse_input_or_output(node, type) node_type = node.element_children.find { |n| n.name == type } { name: node_type.attribute("message").to_s.split(":").last, message: node_type.attribute("message").to_s, action: node_type.attribute("Action").to_s } end |
#parse_port_types ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/soap/parser/port_type.rb', line 19 def parse_port_types return if @node.empty? && @node.first.nil? node_elements = node.first.element_children.select do |op| op.name == "operation" end @hash = Hash[node_elements.map do |operation| [operation["name"], { input: parse_input_or_output(operation, "input"), output: parse_input_or_output(operation, "output") }] end] end |