Class: Aws::Session::Credentials::Config

Inherits:
Object
  • Object
show all
Includes:
FileProvider::YamlFileProvider, ProfileStorage, RoleStorage
Defined in:
lib/aws/session/credentials/config.rb

Overview

Holds configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileProvider::YamlFileProvider

#[], #[]=, #read, #write

Methods included from RoleStorage

#print_roles, #role, #roles, #roles=, #set_role

Methods included from ProfileStorage

#print_profiles, #profile, #profiles, #profiles=, #set_profile

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



12
13
14
# File 'lib/aws/session/credentials/config.rb', line 12

def initialize(options = {})
  @path = File.expand_path(options[:path] || default_path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/aws/session/credentials/config.rb', line 10

def path
  @path
end

Instance Method Details

#default_pathObject



16
17
18
# File 'lib/aws/session/credentials/config.rb', line 16

def default_path
  File.join(%w(~ .aws aws-session-config.yml))
end

#profiles_hashHash<String,Hash>

Returns:

  • (Hash<String,Hash>)


21
22
23
# File 'lib/aws/session/credentials/config.rb', line 21

def profiles_hash
  self[:profiles] || {}
end

#profiles_hash=(hsh) ⇒ Object

Parameters:

  • hsh (Hash)


26
27
28
# File 'lib/aws/session/credentials/config.rb', line 26

def profiles_hash=(hsh)
  self[:profiles] = hsh
end

#roles_hashHash<String,Hash>

Returns:

  • (Hash<String,Hash>)


31
32
33
# File 'lib/aws/session/credentials/config.rb', line 31

def roles_hash
  self[:roles] || {}
end

#roles_hash=(hsh) ⇒ Object

Parameters:

  • hsh (Hash)


36
37
38
# File 'lib/aws/session/credentials/config.rb', line 36

def roles_hash=(hsh)
  self[:roles] = hsh
end