Class: Bitsa::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/bitsa/config_file.rb

Overview

Loads configuration data from a yaml file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file_path_name) ⇒ ConfigFile

Load data from passed file path.



31
32
33
34
35
36
37
# File 'lib/bitsa/config_file.rb', line 31

def initialize(config_file_path_name)
  c_f_n = File.expand_path(config_file_path_name)
  if File.exist?(c_f_n)
    @data = YAML.load_file(c_f_n)
  end
  @data = {} unless @data
end

Instance Attribute Details

#dataObject (readonly)

Loaded configuration data as a Hash.



28
29
30
# File 'lib/bitsa/config_file.rb', line 28

def data
  @data
end