Class: ClashOfClansApi::Api
- Inherits:
-
Object
- Object
- ClashOfClansApi::Api
- Includes:
- ApiFrame::EndpointMethods
- Defined in:
- lib/clash_of_clans_api/api.rb
Constant Summary collapse
- BASE_URI =
URI('https://api.clashofclans.com/v1/')
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
Instance Method Summary collapse
- #base_uri ⇒ Object
- #default_headers ⇒ Object
-
#initialize(api_token) ⇒ Api
constructor
A new instance of Api.
Constructor Details
#initialize(api_token) ⇒ Api
Returns a new instance of Api.
17 18 19 |
# File 'lib/clash_of_clans_api/api.rb', line 17 def initialize(api_token) @api_token = api_token end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
15 16 17 |
# File 'lib/clash_of_clans_api/api.rb', line 15 def api_token @api_token end |
Instance Method Details
#base_uri ⇒ Object
11 12 13 |
# File 'lib/clash_of_clans_api/api.rb', line 11 def base_uri BASE_URI end |
#default_headers ⇒ Object
21 22 23 24 25 |
# File 'lib/clash_of_clans_api/api.rb', line 21 def default_headers { 'Authorization' => "Bearer #{api_token}", } end |