Class: Bitsa::ConfigFile
- Inherits:
-
Object
- Object
- Bitsa::ConfigFile
- Defined in:
- lib/bitsa/config_file.rb
Overview
Loads configuration data from a yaml file.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Loaded configuration data as a Hash.
Instance Method Summary collapse
-
#initialize(config_file_path_name) ⇒ ConfigFile
constructor
Load data from passed file path.
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.(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
#data ⇒ Object (readonly)
Loaded configuration data as a Hash.
28 29 30 |
# File 'lib/bitsa/config_file.rb', line 28 def data @data end |