Method: Inforouter::Responses::Base#match

Defined in:
lib/inforouter/responses/base.rb

#match(chain) ⇒ Object

Match an element in the SOAP response

Parameters:

  • match (String)

    XML path to match.



36
37
38
39
40
41
42
43
44
# File 'lib/inforouter/responses/base.rb', line 36

def match(chain)
  current_value = raw
  chain.split('/').each do |key|
    current_value = current_value[key.to_sym]
    next if current_value
    fail Inforouter::Errors::UnexpectedSOAPResponse.new(raw, key, chain)
  end
  current_value
end