module Decathlon::Sports

Constants

VERSION

Public Class Methods

all(url: " click to toggle source
# File lib/decathlon/sports/sport.rb, line 13
def self.all(url: "#{API_URL}/sports", params: {}, headers: {})
  call(url: url, params: params, headers: headers)
end
call(url: API_URL, params: {}, headers: {}) click to toggle source
# File lib/decathlon/sports/sport.rb, line 8
def self.call(url: API_URL, params: {}, headers: {})
  response = Faraday.get(url, params, headers)
  JSON.parse(response.body)
end
find(id, params: {}, headers: {}) click to toggle source
# File lib/decathlon/sports/sport.rb, line 17
def self.find(id, params: {}, headers: {})
  call(url: "#{API_URL}/sports/#{id}", params: params, headers: headers)
end
isearch(query, params: {}, headers: {}) click to toggle source
# File lib/decathlon/sports/sport.rb, line 25
def self.isearch(query, params: {}, headers: {})
  call(url: "#{API_URL}/sports/search/#{query}", params: params, headers: headers)
end

Public Instance Methods

group(id) click to toggle source
# File lib/decathlon/sports/sport.rb, line 33
def group(id)
  call(url: "#{API_URL}/groups/#{id}")
end
groups() click to toggle source
# File lib/decathlon/sports/sport.rb, line 29
def groups
  call(url: "#{API_URL}/groups")
end