Class: Channable::Response
- Inherits:
-
Object
- Object
- Channable::Response
- Defined in:
- lib/channable/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(response_data) ⇒ Response
constructor
A new instance of Response.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/channable/response.rb', line 4 def data @data end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/channable/response.rb', line 6 def response @response end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
5 6 7 |
# File 'lib/channable/response.rb', line 5 def success @success end |