Class: Opsicle::UserProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/opsicle/user_profile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (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

#arnObject



21
22
23
# File 'lib/opsicle/user_profile.rb', line 21

def arn
  attributes.fetch(:iam_user_arn)
end

#attributesObject



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_usernameObject



13
14
15
# File 'lib/opsicle/user_profile.rb', line 13

def iam_username
  attributes.fetch(:name)
end

#public_keyObject



17
18
19
# File 'lib/opsicle/user_profile.rb', line 17

def public_key
  attributes.fetch(:ssh_public_key)
end

#ssh_usernameObject



9
10
11
# File 'lib/opsicle/user_profile.rb', line 9

def ssh_username
  attributes.fetch(:ssh_username)
end