Class: ClashOfClansApi::Models::Token
- Defined in:
- lib/clash_of_clans_api/models/token.rb
Instance Method Summary collapse
- #client_from_token ⇒ Object
-
#initialize(hash, token_client:) ⇒ Token
constructor
A new instance of Token.
- #revoke ⇒ Object
Methods inherited from Base
#[], #cache_property, property, #property_cached?, #property_from_cache, #to_h, #validate!
Constructor Details
#initialize(hash, token_client:) ⇒ Token
Returns a new instance of Token.
17 18 19 20 21 |
# File 'lib/clash_of_clans_api/models/token.rb', line 17 def initialize(hash, token_client:) super(hash) @token_client = token_client end |
Instance Method Details
#client_from_token ⇒ Object
27 28 29 |
# File 'lib/clash_of_clans_api/models/token.rb', line 27 def client_from_token ClashOfClansApi::Client.new(self.key) end |
#revoke ⇒ Object
23 24 25 |
# File 'lib/clash_of_clans_api/models/token.rb', line 23 def revoke @token_client.revoke_api_key(self.id) end |