Module: Taric
- Defined in:
- lib/taric/operation/api.rb,
lib/taric.rb,
lib/taric/client.rb,
lib/taric/version.rb,
lib/taric/constants.rb,
lib/taric/connection.rb,
lib/taric/configuration.rb,
lib/taric/operation/base.rb,
lib/taric/operation/match.rb,
lib/taric/operation/runes.rb,
lib/taric/operation/league.rb,
lib/taric/operation/champion.rb,
lib/taric/operation/summoner.rb,
lib/taric/operation/masteries.rb,
lib/taric/operation/spectator.rb,
lib/taric/operation/lol_status.rb,
lib/taric/operation/lol_static_data.rb,
lib/taric/operation/champion_mastery.rb,
lib/taric/operation/endpoint_template.rb,
lib/taric/faraday_middleware/http_exception.rb
Overview
Combines operations of LoL API.
Defined Under Namespace
Modules: Connection, FaradayMiddleware, Operation Classes: Client, Configuration
Constant Summary collapse
- VERSION =
'1.0.0'
- RANKED_SOLO_5X5 =
rankedQueues
'RANKED_SOLO_5x5'.freeze
- RANKED_TEAM_3X3 =
'RANKED_TEAM_3x3'.freeze
- RANKED_TEAM_5X5 =
'RANKED_TEAM_5x5'.freeze
- PRESEASON3 =
seasons
'PRESEASON3'.freeze
- SEASON3 =
'SEASON3'.freeze
- PRESEASON2014 =
'PRESEASON2014'.freeze
- SEASON2014 =
'SEASON2014'.freeze
- PRESEASON2015 =
'PRESEASON2015'.freeze
- SEASON2015 =
'SEASON2015'.freeze
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
-
.client(region: :na, api_key: nil, config: @configuration ||= Taric::Configuration.new) ⇒ Taric::Client
Creates a [Taric::Client], the main interface to the LoL API.
-
.configure! {|configuration| ... } ⇒ Object
Sets global configuration.
-
.reset! ⇒ Object
Resets global configuration.
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
9 10 11 |
# File 'lib/taric.rb', line 9 def configuration @configuration end |
Class Method Details
.client(region: :na, api_key: nil, config: @configuration ||= Taric::Configuration.new) ⇒ Taric::Client
Creates a [Taric::Client], the main interface to the LoL API. If the api_key is provided in .configure!, then only the region needs to be set. If .configure! is used, but a different api_key is provided, then the latter takes precedence.
32 33 34 35 36 |
# File 'lib/taric.rb', line 32 def client(region: :na, api_key: nil, config: @configuration ||= Taric::Configuration.new) Taric::Client.new(api_key: api_key || config.api_key, region: region.is_a?(String) ? region.to_sym : region, config: config) end |
.configure! {|configuration| ... } ⇒ Object
Sets global configuration. Should only be called once in a process (e.g. Rails initializer)
46 47 48 49 |
# File 'lib/taric.rb', line 46 def configure! reset! yield(configuration) end |
.reset! ⇒ Object
Resets global configuration.
53 54 55 |
# File 'lib/taric.rb', line 53 def reset! @configuration = Taric::Configuration.new end |