Module: HotsApi

Defined in:
lib/hots_api.rb,
lib/hots_api/fetcher.rb,
lib/hots_api/version.rb,
lib/hots_api/models/map.rb,
lib/hots_api/models/hero.rb,
lib/hots_api/models/model.rb,
lib/hots_api/models/score.rb,
lib/hots_api/models/player.rb,
lib/hots_api/models/replay.rb,
lib/hots_api/models/talent.rb,
lib/hots_api/models/ability.rb,
lib/hots_api/models/uploaded_replay.rb,
lib/hots_api/repositories/repository.rb,
lib/hots_api/repositories/map_repository.rb,
lib/hots_api/repositories/hero_repository.rb,
lib/hots_api/repositories/replay_repository.rb,
lib/hots_api/repositories/simple_repository.rb

Defined Under Namespace

Modules: Models, Repositories Classes: Fetcher

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.fetcherObject



23
24
25
# File 'lib/hots_api.rb', line 23

def self.fetcher
  @fetcher ||= Fetcher.new
end

.get(path, params: {}) ⇒ Object



27
28
29
# File 'lib/hots_api.rb', line 27

def self.get(path, params: {})
  fetcher.get(path, params: params)
end

.heroesObject



39
40
41
# File 'lib/hots_api.rb', line 39

def self.heroes
  Repositories::HeroRepository.new
end

.mapsObject



43
44
45
# File 'lib/hots_api.rb', line 43

def self.maps
  Repositories::MapRepository.new
end

.post(path, body: nil, file: nil) ⇒ Object



31
32
33
# File 'lib/hots_api.rb', line 31

def self.post(path, body: nil, file: nil)
  fetcher.post(path, body: body, file: file)
end

.replaysObject



35
36
37
# File 'lib/hots_api.rb', line 35

def self.replays
  Repositories::ReplayRepository.new
end