Class: ConfigLoader::Yaml
Instance Attribute Summary
Attributes inherited from Base
#ext, #file_name, #file_path, #locale, #path, #root
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(file_path, options = {}) ⇒ Yaml
constructor
A new instance of Yaml.
Methods inherited from Base
Constructor Details
#initialize(file_path, options = {}) ⇒ Yaml
Returns a new instance of Yaml.
5 6 7 8 9 |
# File 'lib/config_loader/yaml.rb', line 5 def initialize file_path, = {} default_ext = [:default_ext] || 'yml' file_path = "#{file_path}.#{default_ext}" unless path?(file_path) super file_path, end |
Instance Method Details
#content ⇒ Object
11 12 13 |
# File 'lib/config_loader/yaml.rb', line 11 def content @content ||= ::YAML.load file_content end |