Class: Rain::Config
- Inherits:
-
Object
- Object
- Rain::Config
- Defined in:
- lib/rain/config.rb
Overview
Holds the configuration options for Rain from versions.yml in a HashWithIndifferentAccess.
Instance Attribute Summary collapse
-
#yaml_file ⇒ Object
readonly
Returns the value of attribute yaml_file.
Instance Method Summary collapse
-
#initialize(root) ⇒ Config
constructor
A new instance of Config.
- #versions ⇒ Object
Constructor Details
#initialize(root) ⇒ Config
Returns a new instance of Config.
9 10 11 |
# File 'lib/rain/config.rb', line 9 def initialize(root) @yaml_file = YAML::load_file "#{root}/config/versions.yml" end |
Instance Attribute Details
#yaml_file ⇒ Object (readonly)
Returns the value of attribute yaml_file.
7 8 9 |
# File 'lib/rain/config.rb', line 7 def yaml_file @yaml_file end |
Instance Method Details
#versions ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rain/config.rb', line 13 def versions @versions ||= if @yaml_file.present? ActiveSupport::HashWithIndifferentAccess.new @yaml_file else false end end |