Class: Opsicle::UserProfile
- Inherits:
-
Object
- Object
- Opsicle::UserProfile
- Defined in:
- lib/opsicle/user_profile.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #arn ⇒ Object
- #attributes ⇒ Object
- #iam_username ⇒ Object
-
#initialize(client) ⇒ UserProfile
constructor
A new instance of UserProfile.
- #public_key ⇒ Object
- #ssh_username ⇒ Object
Constructor Details
#initialize(client) ⇒ UserProfile
Returns a new instance of UserProfile.
5 6 7 |
# File 'lib/opsicle/user_profile.rb', line 5 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/opsicle/user_profile.rb', line 3 def client @client end |
Instance Method Details
#arn ⇒ Object
21 22 23 |
# File 'lib/opsicle/user_profile.rb', line 21 def arn attributes.fetch(:iam_user_arn) end |
#attributes ⇒ Object
25 26 27 |
# File 'lib/opsicle/user_profile.rb', line 25 def attributes @attributes ||= client.api_call(:describe_my_user_profile)[:user_profile] end |
#iam_username ⇒ Object
13 14 15 |
# File 'lib/opsicle/user_profile.rb', line 13 def iam_username attributes.fetch(:name) end |
#public_key ⇒ Object
17 18 19 |
# File 'lib/opsicle/user_profile.rb', line 17 def public_key attributes.fetch(:ssh_public_key) end |
#ssh_username ⇒ Object
9 10 11 |
# File 'lib/opsicle/user_profile.rb', line 9 def ssh_username attributes.fetch(:ssh_username) end |