Class: Aws::Session::Credentials::Cache
- Inherits:
-
Object
- Object
- Aws::Session::Credentials::Cache
- Includes:
- FileProvider::YamlFileProvider, ProfileStorage
- Defined in:
- lib/aws/session/credentials/cache.rb
Overview
Holds session credentials
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #default_path ⇒ Object
-
#initialize(options = {}) ⇒ Cache
constructor
A new instance of Cache.
- #profiles_hash ⇒ Hash<String,Hash>
- #profiles_hash=(hsh) ⇒ Object
Methods included from FileProvider::YamlFileProvider
Methods included from ProfileStorage
#print_profiles, #profile, #profiles, #profiles=, #set_profile
Constructor Details
#initialize(options = {}) ⇒ Cache
Returns a new instance of Cache.
11 12 13 |
# File 'lib/aws/session/credentials/cache.rb', line 11 def initialize( = {}) @path = File.([:path] || default_path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/aws/session/credentials/cache.rb', line 9 def path @path end |
Instance Method Details
#default_path ⇒ Object
15 16 17 |
# File 'lib/aws/session/credentials/cache.rb', line 15 def default_path File.join(%w(~ .aws aws-session-cache.yml)) end |
#profiles_hash ⇒ Hash<String,Hash>
20 21 22 |
# File 'lib/aws/session/credentials/cache.rb', line 20 def profiles_hash self[:profiles] || {} end |
#profiles_hash=(hsh) ⇒ Object
25 26 27 |
# File 'lib/aws/session/credentials/cache.rb', line 25 def profiles_hash=(hsh) self[:profiles] = hsh end |