Class: RubyIsds::Response
- Inherits:
-
Object
- Object
- RubyIsds::Response
- Defined in:
- lib/ruby_isds/response.rb
Direct Known Subclasses
RubyIsds::Responses::Message, RubyIsds::Responses::Messages::Collection, RubyIsds::Responses::Messages::DeliveryInfo, RubyIsds::Responses::Messages::Envelope, RubyIsds::Responses::Messages::Event, WebServices::DbSearch::Response, WebServices::DmInfo::Response, WebServices::DmOperations::Response
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #parsed_body ⇒ Object
- #result_key ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/ruby_isds/response.rb', line 5 def initialize(response) @response = Hash.from_xml(response.body) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/ruby_isds/response.rb', line 3 def body @body end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/ruby_isds/response.rb', line 3 def status @status end |
Instance Method Details
#parsed_body ⇒ Object
9 10 11 12 |
# File 'lib/ruby_isds/response.rb', line 9 def parsed_body raise HtmlResponseReceived, @response.inspect unless @response['Envelope'].present? @response['Envelope']['Body'][result_key] end |
#result_key ⇒ Object
14 15 16 |
# File 'lib/ruby_isds/response.rb', line 14 def result_key @response['Envelope']['Body'].first[0] end |