class NMA::Response
A wrapper around the API response.
Attributes
body[RW]
A hash of the returned XML response
code[RW]
The HTTP status code of the response.
raw[RW]
The response body.
response[RW]
A hash of the cooked XML
Public Class Methods
new(response)
click to toggle source
# File lib/ruby-notify-my-android/response.rb, line 26 def initialize(response) self.raw = response.body self.code = response.code self.body = XmlSimple.xml_in(response.body) self.response = self.body[self.body.keys.first].first end
Public Instance Methods
succeeded?()
click to toggle source
# File lib/ruby-notify-my-android/response.rb, line 33 def succeeded? self.response["code"] == "200" end