Class: HiuHttp
- Inherits:
-
Object
- Object
- HiuHttp
- Defined in:
- lib/hiu_http.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(base_url, uri, method, headers, options = {}) ⇒ HiuHttp
constructor
A new instance of HiuHttp.
Constructor Details
#initialize(base_url, uri, method, headers, options = {}) ⇒ HiuHttp
Returns a new instance of HiuHttp.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/hiu_http.rb', line 6 def initialize(base_url, uri, method, headers, = {}) Excon.defaults[:ssl_verify_peer] = false @method = method @connection = Excon.new( base_url + uri, headers: headers, body: URI.encode_www_form(), tcp_nodelay: true, nonblock: false, ) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/hiu_http.rb', line 4 def connection @connection end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/hiu_http.rb', line 4 def method @method end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/hiu_http.rb', line 18 def call connection.request(method: method) end |