Class: WavesRubyClient::Api

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/waves_ruby_client/api.rb

Overview

Access to waves api

Instance Method Summary collapse

Instance Method Details

#call(path, method = :get, args = {}) ⇒ Object



14
15
16
17
# File 'lib/waves_ruby_client/api.rb', line 14

def call(path, method = :get, args = {})
  response = HTTParty.send(method, WavesRubyClient::API_URL + path, args)
  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