Class: WavesRubyClient::Api
- Inherits:
-
Object
- Object
- WavesRubyClient::Api
- Includes:
- Singleton
- Defined in:
- lib/waves_ruby_client/api.rb
Overview
Access to waves api
Instance Method Summary collapse
- #call(path, method = :get, args = {}) ⇒ Object
- #call_data_feed(path) ⇒ Object
- #call_matcher(path, method = :get, args = {}) ⇒ Object
- #call_node(path) ⇒ Object
Instance Method Details
#call(path, method = :get, args = {}) ⇒ Object
24 25 26 27 |
# File 'lib/waves_ruby_client/api.rb', line 24 def call(path, method = :get, args = {}) response = HTTParty.send(method, WavesRubyClient::MATCHER_URL + path, args) JSON.parse(response.body) end |
#call_data_feed(path) ⇒ Object
19 20 21 22 |
# File 'lib/waves_ruby_client/api.rb', line 19 def call_data_feed(path) response = HTTParty.get(WavesRubyClient::DATA_FEED_URL + path) JSON.parse(response.body) end |
#call_matcher(path, method = :get, args = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/waves_ruby_client/api.rb', line 8 def call_matcher(path, method = :get, args = {}) WavesRubyClient.try_many_times do call("/matcher#{path}", method, args) end end |
#call_node(path) ⇒ Object
14 15 16 17 |
# File 'lib/waves_ruby_client/api.rb', line 14 def call_node(path) response = HTTParty.get(WavesRubyClient::NODE_URL + path) JSON.parse(response.body) end |