Class: Fog::Scaleway::Account::Tokens

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/scaleway/models/account/tokens.rb

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
# File 'lib/fog/scaleway/models/account/tokens.rb', line 7

def all
  tokens = service.list_tokens.body['tokens'] || []
  load(tokens)
end

#get(identity) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fog/scaleway/models/account/tokens.rb', line 12

def get(identity)
  if (token = service.get_token(identity).body['token'])
    new(token)
  end
rescue Fog::Scaleway::Account::UnknownResource
  nil
end