class RunregApi::Client
Constants
- BASE_URL
Public Instance Methods
search(**opts)
click to toggle source
# File lib/runreg_api/client.rb, line 9 def search **opts # Response in format # { # "CompletionTime":0, # "MatchingEvents":[ # { # "Categories":[ # { # "CategoryID":34293 # ... call_api('search', opts)['MatchingEvents'].map do |event| Runreg::Event.new(event) end end
Protected Instance Methods
call_api(path, params = {})
click to toggle source
# File lib/runreg_api/client.rb, line 26 def call_api path, params = {} response = self.class.get("#{BASE_URL}/#{path}", query: params) if response.code == 200 response.parsed_response else raise Error.new response.body end end