Class: Aviator::Response
- Extended by:
- Forwardable
- Defined in:
- lib/puppet/feature/aviator/core/response.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(response, request) ⇒ Response
constructor
A new instance of Response.
- #to_hash ⇒ Object
Constructor Details
#initialize(response, request) ⇒ Response
Returns a new instance of Response.
10 11 12 13 |
# File 'lib/puppet/feature/aviator/core/response.rb', line 10 def initialize(response, request) @response = response @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
8 9 10 |
# File 'lib/puppet/feature/aviator/core/response.rb', line 8 def request @request end |
Instance Method Details
#body ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/puppet/feature/aviator/core/response.rb', line 16 def body @body ||= if raw_body.length > 0 if Aviator::Compatibility::RUBY_1_8_MODE clean_body = raw_body.gsub(/\\ /, ' ') else clean_body = raw_body end Hashish.new(JSON.parse(clean_body)) else Hashish.new({}) end end |