Class: ProxiedRequest::Config
- Inherits:
-
Object
- Object
- ProxiedRequest::Config
- Defined in:
- lib/proxied_request/config.rb
Instance Method Summary collapse
- #body=(body) ⇒ Object
- #get_body ⇒ Object
- #get_headers ⇒ Object
- #get_port ⇒ Object
- #get_proxy ⇒ Object
- #get_timeout ⇒ Object
- #get_type ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #port=(port) ⇒ Object
- #proxy=(proxy) ⇒ Object
- #set_header(key, value) ⇒ Object
- #timeout=(timeout) ⇒ Object
- #type=(type) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/proxied_request/config.rb', line 8 def initialize @proxy = "127.0.0.1" @port = 9050 @type = MethodType::GET @headers = {} @body = nil @timeout = 10 end |
Instance Method Details
#body=(body) ⇒ Object
19 20 21 |
# File 'lib/proxied_request/config.rb', line 19 def body=(body) @body = body end |
#get_body ⇒ Object
63 64 65 |
# File 'lib/proxied_request/config.rb', line 63 def get_body @body end |
#get_headers ⇒ Object
51 52 53 |
# File 'lib/proxied_request/config.rb', line 51 def get_headers @headers end |
#get_port ⇒ Object
47 48 49 |
# File 'lib/proxied_request/config.rb', line 47 def get_port @port end |
#get_proxy ⇒ Object
43 44 45 |
# File 'lib/proxied_request/config.rb', line 43 def get_proxy @proxy end |
#get_timeout ⇒ Object
55 56 57 |
# File 'lib/proxied_request/config.rb', line 55 def get_timeout @timeout end |
#get_type ⇒ Object
59 60 61 |
# File 'lib/proxied_request/config.rb', line 59 def get_type @type end |
#port=(port) ⇒ Object
31 32 33 |
# File 'lib/proxied_request/config.rb', line 31 def port=(port) @port = port end |
#proxy=(proxy) ⇒ Object
27 28 29 |
# File 'lib/proxied_request/config.rb', line 27 def proxy=(proxy) @proxy = proxy end |
#set_header(key, value) ⇒ Object
35 36 37 |
# File 'lib/proxied_request/config.rb', line 35 def set_header(key, value) @headers[key] = value end |
#timeout=(timeout) ⇒ Object
39 40 41 |
# File 'lib/proxied_request/config.rb', line 39 def timeout=(timeout) @timeout = timeout end |
#type=(type) ⇒ Object
23 24 25 |
# File 'lib/proxied_request/config.rb', line 23 def type=(type) @type = type end |