Class: AdobeConnect::Response

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/adobe_connect/response.rb

Overview

Public: A response from the Connect API.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/adobe_connect/response.rb', line 7

def body
  @body
end

#statusObject (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