Class: Rain::Config

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

Overview

Holds the configuration options for Rain from versions.yml in a HashWithIndifferentAccess.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_fileObject (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

#versionsObject



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