Class: Fog::AWS::IAM::SshPublicKeys
- Inherits:
-
Collection
- Object
- Collection
- Fog::AWS::IAM::SshPublicKeys
- Defined in:
- lib/fog/aws/models/iam/ssh_public_keys.rb
Instance Method Summary collapse
- #all ⇒ Object
- #get(identity) ⇒ Object
-
#initialize(attributes = {}) ⇒ SshPublicKeys
constructor
A new instance of SshPublicKeys.
- #new(attributes = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ SshPublicKeys
Returns a new instance of SshPublicKeys.
9 10 11 12 |
# File 'lib/fog/aws/models/iam/ssh_public_keys.rb', line 9 def initialize(attributes = {}) @username = attributes[:username] super end |
Instance Method Details
#all ⇒ Object
14 15 16 17 |
# File 'lib/fog/aws/models/iam/ssh_public_keys.rb', line 14 def all data = service.list_ssh_public_keys('UserName'=> @username).body['SSHPublicKeys'] load(data) end |
#get(identity) ⇒ Object
19 20 21 |
# File 'lib/fog/aws/models/iam/ssh_public_keys.rb', line 19 def get(identity) self.all.select {|ssh_public_key| ssh_public_key.id == identity}.first end |
#new(attributes = {}) ⇒ Object
23 24 25 |
# File 'lib/fog/aws/models/iam/ssh_public_keys.rb', line 23 def new(attributes = {}) super({username: @username }.merge!(attributes)) end |