Module: ConfigStore::TokenClientMethods
- Included in:
- Client
- Defined in:
- lib/configstore/clients/token_client_methods.rb
Instance Method Summary collapse
- #create_token(token) ⇒ Object
- #delete_token(token_uuid) ⇒ Object
- #get_token(token_uuid) ⇒ Object
- #list_tokens ⇒ Object
- #update_token(token_uuid, token) ⇒ Object
Instance Method Details
#create_token(token) ⇒ Object
14 15 16 |
# File 'lib/configstore/clients/token_client_methods.rb', line 14 def create_token(token) return ConfigStore::Token.from_api_hash(@api.create_token(token.to_api_hash)) end |
#delete_token(token_uuid) ⇒ Object
22 23 24 |
# File 'lib/configstore/clients/token_client_methods.rb', line 22 def delete_token(token_uuid) return @api.delete_token(token_uuid) end |
#get_token(token_uuid) ⇒ Object
10 11 12 |
# File 'lib/configstore/clients/token_client_methods.rb', line 10 def get_token(token_uuid) return ConfigStore::Token.from_api_hash(@api.get_token(token_uuid)) end |
#list_tokens ⇒ Object
4 5 6 7 8 |
# File 'lib/configstore/clients/token_client_methods.rb', line 4 def list_tokens return @api.list_tokens.map do |raw_token| next(ConfigStore::Token.from_api_hash(raw_token)) end end |
#update_token(token_uuid, token) ⇒ Object
18 19 20 |
# File 'lib/configstore/clients/token_client_methods.rb', line 18 def update_token(token_uuid, token) return ConfigStore::Token.from_api_hash(@api.update_token(token_uuid, token.to_api_hash)) end |