Class: SsmConfig::SsmStorage::Yml
- Inherits:
-
Object
- Object
- SsmConfig::SsmStorage::Yml
- Defined in:
- lib/ssm_config/ssm_storage/yml.rb
Constant Summary collapse
- CONFIG_PATH =
'config'.freeze
Instance Method Summary collapse
- #file_exists? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(file_name) ⇒ Yml
constructor
A new instance of Yml.
Constructor Details
#initialize(file_name) ⇒ Yml
Returns a new instance of Yml.
5 6 7 |
# File 'lib/ssm_config/ssm_storage/yml.rb', line 5 def initialize(file_name) @file_name = file_name end |
Instance Method Details
#file_exists? ⇒ Boolean
9 10 11 |
# File 'lib/ssm_config/ssm_storage/yml.rb', line 9 def file_exists? File.exist?(file_path) end |
#hash ⇒ Object
13 14 15 16 |
# File 'lib/ssm_config/ssm_storage/yml.rb', line 13 def hash yaml_loaded = YAML.load(ERB.new(File.read((file_path).to_s)).result) (yaml_loaded[Rails.env] || yaml_loaded['any']).try(:with_indifferent_access) end |