Class: TingYun::Http::HttpClientRequest
- Inherits:
-
GenericRequest
- Object
- GenericRequest
- TingYun::Http::HttpClientRequest
- Defined in:
- lib/ting_yun/http/http_client_request.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #args ⇒ Object
- #from ⇒ Object
-
#initialize(proxy, *args, &block) ⇒ HttpClientRequest
constructor
A new instance of HttpClientRequest.
- #type ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(proxy, *args, &block) ⇒ HttpClientRequest
Returns a new instance of HttpClientRequest.
7 8 9 10 11 |
# File 'lib/ting_yun/http/http_client_request.rb', line 7 def initialize(proxy, *args, &block) @method, @uri, @query, @body, @header = args @proxy = proxy @block = block end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
5 6 7 |
# File 'lib/ting_yun/http/http_client_request.rb', line 5 def header @header end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
5 6 7 |
# File 'lib/ting_yun/http/http_client_request.rb', line 5 def method @method end |
Instance Method Details
#[](key) ⇒ Object
21 22 23 |
# File 'lib/ting_yun/http/http_client_request.rb', line 21 def [](key) @header[key] end |
#[]=(key, value) ⇒ Object
25 26 27 |
# File 'lib/ting_yun/http/http_client_request.rb', line 25 def []=(key, value) @header[key] = value end |
#args ⇒ Object
34 35 36 |
# File 'lib/ting_yun/http/http_client_request.rb', line 34 def args return @method, @uri, @query, @body, @header end |
#from ⇒ Object
17 18 19 |
# File 'lib/ting_yun/http/http_client_request.rb', line 17 def from "http_client%2Fhttp" end |
#type ⇒ Object
13 14 15 |
# File 'lib/ting_yun/http/http_client_request.rb', line 13 def type 'HTTPClient' end |
#uri ⇒ Object
29 30 31 32 |
# File 'lib/ting_yun/http/http_client_request.rb', line 29 def uri return @uri if @uri.scheme && @uri.host && @uri.port URI("#{@proxy.scheme.downcase}://#{@proxy.host}:#{@proxy.port}#{@uri}") end |