Class: RubyProxyHeaders::Typhoeus::ProxyResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_proxy_headers/typhoeus.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.



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

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



93
94
95
# File 'lib/ruby_proxy_headers/typhoeus.rb', line 93

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.



70
71
72
# File 'lib/ruby_proxy_headers/typhoeus.rb', line 70

def proxy_response_headers
  @proxy_response_headers
end

Instance Method Details

#bodyObject



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

def body
  @response.body
end

#codeObject



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

def code
  @response.code
end

#headersObject



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

def headers
  @response.headers
end

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

Returns:

  • (Boolean)


97
98
99
# File 'lib/ruby_proxy_headers/typhoeus.rb', line 97

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

#success?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/ruby_proxy_headers/typhoeus.rb', line 89

def success?
  @response.success?
end