Module: Decathlon::Sports::Recommendations

Defined in:
lib/decathlon/sports/recommendation.rb

Class Method Summary collapse

Class Method Details

.get(id) ⇒ Object



7
8
9
10
# File 'lib/decathlon/sports/recommendation.rb', line 7

def self.get(id)
  response = Faraday.get("#{API_URL}/sports/#{id}/recommendations")
  JSON.parse(response.body)
end

.location(coordinates, source = 'popular', limit = 10) ⇒ Object



12
13
14
15
# File 'lib/decathlon/sports/recommendation.rb', line 12

def self.location(coordinates, source = 'popular', limit = 10)
  response = Faraday.get("#{API_URL}/sports/recommendations?coordinates=#{coordinates[:lon]},#{coordinates[:lat]}&source=#{source}&count=#{limit}")
  JSON.parse(response.body)
end