Class: RubyProxyHeaders::RestClient::ProxyResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_proxy_headers/rest_client.rb

Overview

Response wrapper with proxy headers accessor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, proxy_headers) ⇒ ProxyResponse

Returns a new instance of ProxyResponse.



64
65
66
67
# File 'lib/ruby_proxy_headers/rest_client.rb', line 64

def initialize(response, proxy_headers)
  @response = response
  @proxy_response_headers = proxy_headers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



81
82
83
# File 'lib/ruby_proxy_headers/rest_client.rb', line 81

def method_missing(method, *args, &block)
  @response.send(method, *args, &block)
end

Instance Attribute Details

#proxy_response_headersObject (readonly)

Returns the value of attribute proxy_response_headers.



62
63
64
# File 'lib/ruby_proxy_headers/rest_client.rb', line 62

def proxy_response_headers
  @proxy_response_headers
end

Instance Method Details

#bodyObject



73
74
75
# File 'lib/ruby_proxy_headers/rest_client.rb', line 73

def body
  @response.body
end

#codeObject



69
70
71
# File 'lib/ruby_proxy_headers/rest_client.rb', line 69

def code
  @response.code
end

#headersObject



77
78
79
# File 'lib/ruby_proxy_headers/rest_client.rb', line 77

def headers
  @response.headers
end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/ruby_proxy_headers/rest_client.rb', line 85

def respond_to_missing?(method, include_private = false)
  @response.respond_to?(method, include_private) || super
end