Module: Gamertag::Configuration
- Included in:
- Gamertag
- Defined in:
- lib/gamertag/configuration.rb
Constant Summary collapse
- OPTION_KEYS =
[ :endpoint_url, :api_version, :adapter ]
- DEFAULT_ENDPOINT_URL =
'https://www.xboxleaders.com'
- DEFAULT_API_VERSION =
'2.0'
- DEFAULT_ADAPTER =
Faraday.default_adapter
Class Method Summary collapse
Instance Method Summary collapse
- #adapter=(adapter) ⇒ Object
- #api_version=(api_version) ⇒ Object
- #configure {|_self| ... } ⇒ Object
- #defaults ⇒ Object
- #endpoint_url=(endpoint_url) ⇒ Object
- #options ⇒ Object
Class Method Details
.extended(base) ⇒ Object
18 19 20 |
# File 'lib/gamertag/configuration.rb', line 18 def self.extended(base) base.defaults end |
Instance Method Details
#adapter=(adapter) ⇒ Object
36 37 38 |
# File 'lib/gamertag/configuration.rb', line 36 def adapter=(adapter) @adapter = adapter end |
#api_version=(api_version) ⇒ Object
44 45 46 |
# File 'lib/gamertag/configuration.rb', line 44 def api_version=(api_version) @api_version = api_version end |
#configure {|_self| ... } ⇒ Object
22 23 24 |
# File 'lib/gamertag/configuration.rb', line 22 def configure yield self end |
#defaults ⇒ Object
30 31 32 33 34 |
# File 'lib/gamertag/configuration.rb', line 30 def defaults self.endpoint_url = DEFAULT_ENDPOINT_URL self.api_version = DEFAULT_API_VERSION self.adapter = DEFAULT_ADAPTER end |
#endpoint_url=(endpoint_url) ⇒ Object
40 41 42 |
# File 'lib/gamertag/configuration.rb', line 40 def endpoint_url=(endpoint_url) @endpoint_url = endpoint_url end |
#options ⇒ Object
26 27 28 |
# File 'lib/gamertag/configuration.rb', line 26 def OPTION_KEYS.inject({}){|o,k| o.merge!(k => send(k)) } end |