class RakutenRms::Response

Attributes

body[R]
headers[R]
response[R]
status[R]

Public Class Methods

new(response) click to toggle source
# File lib/rakuten_rms/response.rb, line 5
def initialize(response)
  @response = response
  @status   = response.try(:status) || response.try(:code)
  @headers  = response.headers
  @body     = response.body
end

Public Instance Methods

success?() click to toggle source
# File lib/rakuten_rms/response.rb, line 12
def success?
  !!(@status.to_s =~ /\A2[0-9]{2}\z/)
end
to_h() click to toggle source
# File lib/rakuten_rms/response.rb, line 16
def to_h
  Hash.from_xml(body)
end