Class: RunregApi::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/runreg_api/client.rb

Constant Summary collapse

BASE_URL =
"https://www.runreg.com/api"

Instance Method Summary collapse

Instance Method Details

#search(**opts) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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