Class: EasyHtmlGenerator::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_html_generator/config.rb

Overview

this class loads a yml file, symbolizes the keys and make the hash accessable via object attributes

Defined Under Namespace

Classes: ConfigHash

Class Method Summary collapse

Class Method Details

.from_file(path) ⇒ Object



7
8
9
10
11
# File 'lib/easy_html_generator/config.rb', line 7

def self.from_file(path)
  return unless File.exist? path

  ConfigHash.new YAML.load(File.open(path))
end