Class: Channable::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_data) ⇒ Response

Returns a new instance of Response.



8
9
10
11
12
# File 'lib/channable/response.rb', line 8

def initialize(response_data)
  @response = response_data
  @success = response_data.success?
  @data = JSON.parse(response_data.body, object_class: OpenStruct)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/channable/response.rb', line 4

def data
  @data
end

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/channable/response.rb', line 6

def response
  @response
end

#successObject (readonly)

Returns the value of attribute success.



5
6
7
# File 'lib/channable/response.rb', line 5

def success
  @success
end