Class: Fog::AWS::IAM::AccessKeys
- Inherits:
-
Collection
- Object
- Collection
- Fog::AWS::IAM::AccessKeys
- Defined in:
- lib/fog/aws/models/iam/access_keys.rb
Instance Method Summary collapse
- #all ⇒ Object
- #get(identity) ⇒ Object
-
#initialize(attributes = {}) ⇒ AccessKeys
constructor
A new instance of AccessKeys.
- #new(attributes = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ AccessKeys
Returns a new instance of AccessKeys.
10 11 12 13 |
# File 'lib/fog/aws/models/iam/access_keys.rb', line 10 def initialize(attributes = {}) @username = attributes[:username] super end |
Instance Method Details
#all ⇒ Object
15 16 17 18 19 20 |
# File 'lib/fog/aws/models/iam/access_keys.rb', line 15 def all data = service.list_access_keys('UserName'=> @username).body['AccessKeys'] # AWS response doesn't contain the UserName, this injects it data.each {|access_key| access_key['UserName'] = @username } load(data) end |
#get(identity) ⇒ Object
22 23 24 |
# File 'lib/fog/aws/models/iam/access_keys.rb', line 22 def get(identity) self.all.select {|access_key| access_key.id == identity}.first end |
#new(attributes = {}) ⇒ Object
26 27 28 |
# File 'lib/fog/aws/models/iam/access_keys.rb', line 26 def new(attributes = {}) super({ :username => @username }.merge!(attributes)) end |