Class: Smiten::Smite

Inherits:
Core
  • Object
show all
Defined in:
lib/smiten/smite.rb

Overview

The Smite class implements those calls that are specific to the Smite endpoint

Instance Attribute Summary

Attributes inherited from Core

#authKey, #calls, #connector, #developerId, #language_code, #portal_id

Instance Method Summary collapse

Methods inherited from Core

#boilerplate, #core_api, #for_champion, #get, #in_language, #incept, #session_id, #signature, #textify, #timestamp

Constructor Details

#initialize(options) ⇒ Smite

See Core



5
6
7
8
# File 'lib/smiten/smite.rb', line 5

def initialize(options)
  options.merge!(url: SmiteEndpoint)
  super(options)
end

Instance Method Details

#build_apisObject

:nodoc:



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/smiten/smite.rb', line 10

def build_apis # :nodoc:
  @calls = {
    get_gods:                  ['God',     -> { "#{boilerplate('getgods')}/#{language_code}"}],
    get_god_leaderboard:       [nil,       -> { "#{boilerplate('getgodleaderboard')}/#{god_id}/#{queue_id}"}],
    get_god_skins:             ['GodSkin', -> { "#{boilerplate('getgodskins')}/#{god_id}/#{language_code}"}],
    get_god_recommended_items: [nil,       -> { "#{boilerplate('getgodrecommendeditems')}/#{god_id}/#{language_code}"}],
    get_god_ranks:             [nil,       -> { "#{boilerplate('getgodranks')}/#{player_id}"}],
    get_player_achievements:   [nil,       -> { "#{boilerplate('getplayerachievements')}/#{player_id}" }],
    search_teams:              [nil,       -> { "#{boilerplate('searchteams')}/#{search_string}" }],
  }
  super
end