Class: ConfigReader

Inherits:
Object
  • Object
show all
Defined in:
lib/config-reader.rb,
lib/config-reader/version.rb

Constant Summary collapse

VERSION =
'0.0.2'

Class Method Summary collapse

Class Method Details

.load(path, env) ⇒ OpenStruct

Process IO as ERB and then YAML and return results as OpenStruct

Parameters:

  • path (String)
  • env (String, Symbol)

Returns:

  • (OpenStruct)


12
13
14
# File 'lib/config-reader.rb', line 12

def self.load(path, env)
  OpenStruct.new(YAML.load(ERB.new(IO.read(path)).result)[env.to_s])
end