Class: ConfigLoader::Yaml

Inherits:
Base
  • Object
show all
Defined in:
lib/config_loader/yaml.rb

Instance Attribute Summary

Attributes inherited from Base

#ext, #file_name, #file_path, #locale, #path, #root

Instance Method Summary collapse

Methods inherited from Base

#as_hash, #load

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, options = {}
  default_ext = options[:default_ext] || 'yml'
  file_path = "#{file_path}.#{default_ext}" unless path?(file_path)
  super file_path, options
end

Instance Method Details

#contentObject



11
12
13
# File 'lib/config_loader/yaml.rb', line 11

def content
	@content ||= ::YAML.load file_content
end