Sha256: 0e47a62353b47b7d16757563297ace6872f93cfb106a38c7fc5b315a712528bb

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

module Nuncium
  class Response
    attr_accessor :status, :body

    def initialize(response)
      @response = Hash.from_xml(response.body)
    end

    def parsed_body
      raise HtmlResponseReceived, @response.inspect unless @response['Envelope'].present?
      @response['Envelope']['Body'][result_key]
    end

    def result_key
      @response['Envelope']['Body'].first[0]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nuncium-0.13.0 lib/nuncium/response.rb