Class: ConfigReader
- Inherits:
-
Object
- Object
- ConfigReader
- 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
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(file_path, environment) ⇒ ConfigReader
constructor
A new instance of ConfigReader.
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
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
8 9 10 |
# File 'lib/config-reader.rb', line 8 def environment @environment end |
#file_path ⇒ Object (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
#config ⇒ Object
15 16 17 |
# File 'lib/config-reader.rb', line 15 def config @config ||= OpenStruct.new(yaml) end |