Class: Aws::Session::Credentials::Config
- Inherits:
-
Object
- Object
- Aws::Session::Credentials::Config
- Includes:
- FileProvider::YamlFileProvider, ProfileStorage, RoleStorage
- Defined in:
- lib/aws/session/credentials/config.rb
Overview
Holds configuration
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #default_path ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #profiles_hash ⇒ Hash<String,Hash>
- #profiles_hash=(hsh) ⇒ Object
- #roles_hash ⇒ Hash<String,Hash>
- #roles_hash=(hsh) ⇒ Object
Methods included from FileProvider::YamlFileProvider
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( = {}) @path = File.([:path] || default_path) end |
Instance Attribute Details
#path ⇒ Object (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_path ⇒ Object
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_hash ⇒ 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
26 27 28 |
# File 'lib/aws/session/credentials/config.rb', line 26 def profiles_hash=(hsh) self[:profiles] = hsh end |
#roles_hash ⇒ 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
36 37 38 |
# File 'lib/aws/session/credentials/config.rb', line 36 def roles_hash=(hsh) self[:roles] = hsh end |