Class: ConfigReader

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

Overview

Process the input as ERB and then YAML and return results as OpenStruct

Constant Summary collapse

VERSION =
'0.1.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, environment) ⇒ ConfigReader

Returns a new instance of ConfigReader.



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

def initialize(file_path, environment)
  @file_path = file_path
  @environment = environment.to_s
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



8
9
10
# File 'lib/config-reader.rb', line 8

def environment
  @environment
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



8
9
10
# File 'lib/config-reader.rb', line 8

def file_path
  @file_path
end

Instance Method Details

#configObject



15
16
17
# File 'lib/config-reader.rb', line 15

def config
  @config ||= OpenStruct.new(yaml)
end