Class: Foxtrot::Client
- Inherits:
-
Object
- Object
- Foxtrot::Client
- Defined in:
- lib/foxtrot/client.rb
Class Attribute Summary collapse
-
.host ⇒ Object
Returns the value of attribute host.
-
.ssl ⇒ Object
Returns the value of attribute ssl.
Instance Method Summary collapse
-
#initialize(api_key, version = 'v1') ⇒ Client
constructor
A new instance of Client.
- #optimize!(data, args = {}) ⇒ Object
- #poll!(endpoint, txid, args = {}) ⇒ Object
Constructor Details
#initialize(api_key, version = 'v1') ⇒ Client
Returns a new instance of Client.
18 19 20 21 22 |
# File 'lib/foxtrot/client.rb', line 18 def initialize(api_key, version='v1') @api_key = api_key @version = version @headers = {:content_type => :json, :accept => :json} end |
Class Attribute Details
.host ⇒ Object
Returns the value of attribute host.
12 13 14 |
# File 'lib/foxtrot/client.rb', line 12 def host @host end |
.ssl ⇒ Object
Returns the value of attribute ssl.
12 13 14 |
# File 'lib/foxtrot/client.rb', line 12 def ssl @ssl end |
Instance Method Details
#optimize!(data, args = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/foxtrot/client.rb', line 29 def optimize!(data, args={}) check_required 'optimize', data resp = post_request 'optimize', data, args Foxtrot::Response::Response.response_for('optimize', resp, self) end |
#poll!(endpoint, txid, args = {}) ⇒ Object
24 25 26 27 |
# File 'lib/foxtrot/client.rb', line 24 def poll!(endpoint, txid, args={}) resp = get_request(endpoint, {txid: txid}) Foxtrot::Response::Response.response_for(endpoint, resp, self) end |