Class: Orchestrate::API::Response
- Inherits:
-
Object
- Object
- Orchestrate::API::Response
- Defined in:
- lib/orchestrate_api/response.rb
Overview
Transforms the HTTParty response into a structure that provides ready access to relevant orchestrate.io response data.
Defined Under Namespace
Classes: Header
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
ResponseBody.
-
#header ⇒ Object
readonly
Header.
Instance Method Summary collapse
-
#initialize(partay) ⇒ Response
constructor
Creates Header and ResponseBody objects from the HTTParty response.
-
#success? ⇒ Boolean
Returns the value of HTTParty.success?.
Constructor Details
#initialize(partay) ⇒ Response
Creates Header and ResponseBody objects from the HTTParty response. Let’s Partay!
16 17 18 19 20 |
# File 'lib/orchestrate_api/response.rb', line 16 def initialize(partay) @success = partay.success? @header = Header.new partay.headers, partay.code, partay.msg @body = ResponseBody.new partay.body end |
Instance Attribute Details
#body ⇒ Object (readonly)
ResponseBody
11 12 13 |
# File 'lib/orchestrate_api/response.rb', line 11 def body @body end |
#header ⇒ Object (readonly)
Header
8 9 10 |
# File 'lib/orchestrate_api/response.rb', line 8 def header @header end |
Instance Method Details
#success? ⇒ Boolean
Returns the value of HTTParty.success?
23 24 25 |
# File 'lib/orchestrate_api/response.rb', line 23 def success? @success end |