Class: HTTParty::ResponseFragment

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/httparty/response_fragment.rb

Overview

Allow access to http_response and code by delegation on fragment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fragment, http_response, connection) ⇒ ResponseFragment

Returns a new instance of ResponseFragment


12
13
14
15
16
17
# File 'lib/httparty/response_fragment.rb', line 12

def initialize(fragment, http_response, connection)
  @fragment = fragment
  @http_response = http_response
  @connection = connection
  super fragment
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection


6
7
8
# File 'lib/httparty/response_fragment.rb', line 6

def connection
  @connection
end

#http_responseObject (readonly)

Returns the value of attribute http_response


6
7
8
# File 'lib/httparty/response_fragment.rb', line 6

def http_response
  @http_response
end

Instance Method Details

#codeObject


8
9
10
# File 'lib/httparty/response_fragment.rb', line 8

def code
  @http_response.code.to_i
end