class Stellae::Response

Constants

CODES

Attributes

response[RW]
result[RW]
status[RW]

Public Class Methods

new(raw_response, type) click to toggle source
# File lib/stellae/response.rb, line 17
def initialize(raw_response, type)
  build_response(raw_response)
  @type = type
end

Public Instance Methods

build_response(raw_response) click to toggle source
# File lib/stellae/response.rb, line 22
def build_response(raw_response)
  @response ||= {
    raw:    raw_response,
    parsed: parse_response(raw_response)
  }
end
error() click to toggle source
# File lib/stellae/response.rb, line 29
def error
  "Stellae::Error - #{status}"
end
failure?() click to toggle source
# File lib/stellae/response.rb, line 33
def failure?
  !success?
end
parse_response(xml_response) click to toggle source
# File lib/stellae/response.rb, line 53
def parse_response(xml_response)
  return nil if xml_response.empty?
  XmlSimple.xml_in(xml_response)
end
raw_status() click to toggle source
# File lib/stellae/response.rb, line 41
def raw_status
  result['status'][0]
end
success?() click to toggle source
# File lib/stellae/response.rb, line 49
def success?
  status == 'success'
end