Class: HTTParty::FragmentWithResponse
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- HTTParty::FragmentWithResponse
- Extended by:
- Forwardable
- Defined in:
- lib/httparty/fragment_with_response.rb
Overview
Allow access to http_response and code by delegation on fragment
Instance Attribute Summary collapse
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(fragment, http_response) ⇒ FragmentWithResponse
constructor
A new instance of FragmentWithResponse.
Constructor Details
#initialize(fragment, http_response) ⇒ FragmentWithResponse
Returns a new instance of FragmentWithResponse.
14 15 16 17 18 |
# File 'lib/httparty/fragment_with_response.rb', line 14 def initialize(fragment, http_response) @fragment = fragment @http_response = http_response super fragment end |
Instance Attribute Details
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response.
8 9 10 |
# File 'lib/httparty/fragment_with_response.rb', line 8 def http_response @http_response end |
Instance Method Details
#code ⇒ Object
10 11 12 |
# File 'lib/httparty/fragment_with_response.rb', line 10 def code @http_response.code.to_i end |