Class: Heirloom::Config
- Inherits:
-
Object
- Object
- Heirloom::Config
- Defined in:
- lib/heirloom/config.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#metadata_region ⇒ Object
Returns the value of attribute metadata_region.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#use_iam_profile ⇒ Object
Returns the value of attribute use_iam_profile.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Config
constructor
A new instance of Config.
- #load_config ⇒ Object
- #proxy ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 |
# File 'lib/heirloom/config.rb', line 6 def initialize(args={}) @opts = args[:opts] ||= Hash.new @logger = args[:logger] ||= HeirloomLogger.new @environment = args[:environment] ||= 'default' @config = load_config_file load_config end |
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def access_key @access_key end |
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def environment @environment end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def logger @logger end |
#metadata_region ⇒ Object
Returns the value of attribute metadata_region.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def secret_key @secret_key end |
#use_iam_profile ⇒ Object
Returns the value of attribute use_iam_profile.
4 5 6 |
# File 'lib/heirloom/config.rb', line 4 def use_iam_profile @use_iam_profile end |
Instance Method Details
#load_config ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/heirloom/config.rb', line 14 def load_config @access_key = @opts.fetch :aws_access_key, @config['access_key'] @secret_key = @opts.fetch :aws_secret_key, @config['secret_key'] = @opts.fetch :metadata_region, @config['metadata_region'] @use_iam_profile = @opts.fetch :use_iam_profile, false end |
#proxy ⇒ Object
25 26 27 |
# File 'lib/heirloom/config.rb', line 25 def proxy @proxy ||= env.load 'https_proxy' end |