Class: AdobeConnect::Response
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- AdobeConnect::Response
- Defined in:
- lib/adobe_connect/response.rb
Overview
Public: A response from the Connect API.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#fetch(header) ⇒ Object
Public: Fetch the given header’s value.
-
#initialize(response) ⇒ Response
constructor
Public: Create a new AdobeConnect::Response.
Constructor Details
#initialize(response) ⇒ Response
Public: Create a new AdobeConnect::Response.
response - A Net::HTTP response.
12 13 14 15 16 17 18 |
# File 'lib/adobe_connect/response.rb', line 12 def initialize(response) @response = response @status = response.code.to_i @body = Nokogiri::XML(response.body) __setobj__(@body) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/adobe_connect/response.rb', line 7 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/adobe_connect/response.rb', line 7 def status @status end |
Instance Method Details
#fetch(header) ⇒ Object
Public: Fetch the given header’s value.
header - The string name of the header to fetch.
Returns a header value as a string.
25 26 27 |
# File 'lib/adobe_connect/response.rb', line 25 def fetch(header) @response.fetch(header) end |