Class: Fog::AWS::IAM::AccessKeys

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/aws/models/iam/access_keys.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AccessKeys

Returns a new instance of AccessKeys.



9
10
11
12
# File 'lib/fog/aws/models/iam/access_keys.rb', line 9

def initialize(attributes = {})
  @username = attributes[:username]
  super
end

Instance Method Details

#allObject



14
15
16
17
# File 'lib/fog/aws/models/iam/access_keys.rb', line 14

def all
  data = service.list_access_keys('UserName'=> @username).body['AccessKeys']
  load(data)
end

#get(identity) ⇒ Object



19
20
21
# File 'lib/fog/aws/models/iam/access_keys.rb', line 19

def get(identity)
  self.all.select {|access_key| access_key.id == identity}.first
end

#new(attributes = {}) ⇒ Object



23
24
25
# File 'lib/fog/aws/models/iam/access_keys.rb', line 23

def new(attributes = {})
  super({ :username => @username }.merge!(attributes))
end