Class: WCC::Arena::Response
- Inherits:
-
Object
- Object
- WCC::Arena::Response
- Defined in:
- lib/wcc/arena/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Response
constructor
A new instance of Response.
- #xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 |
# File 'lib/wcc/arena/response.rb', line 6 def initialize(args={}) @status = args[:status] @headers = args[:headers] @body = args[:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/wcc/arena/response.rb', line 4 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/wcc/arena/response.rb', line 4 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/wcc/arena/response.rb', line 4 def status @status end |
Instance Method Details
#xml ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/wcc/arena/response.rb', line 12 def xml if headers['content-type'] =~ %r[application/xml] Nokogiri::XML.parse(@body) else Nokogiri::XML::Document.new end end |