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