class SimpleShipping::Abstract::Response

Represents a response returned by the remote service for a request initiated by {SimpleShipping::Abstract::Client client}.

An abstract class which provides a common interface. In the real world, you will deal with its subclasses:

Example:

response = client.request(shipper, recipient, package)
response.response # => #<Savon::SOAP::Response ...>

Attributes

response[R]

Public Class Methods

new(savon_resp = nil) click to toggle source
# File lib/simple_shipping/abstract/response.rb, line 16
def initialize(savon_resp = nil)
  @response = savon_resp
end

Public Instance Methods

value_of(*path) click to toggle source

Fetch the value of an XML attribute at the path specified as an array. of node names

# File lib/simple_shipping/abstract/response.rb, line 22
def value_of(*path)
  @response.to_array(*path).first
end