Class: GAShikomi::Config
- Inherits:
-
Object
- Object
- GAShikomi::Config
- Defined in:
- lib/ga_shikomi/config.rb
Defined Under Namespace
Classes: FileNotFound
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(file) ⇒ Config
constructor
A new instance of Config.
- #load(file) ⇒ Object
Constructor Details
#initialize(file) ⇒ Config
5 6 7 8 9 |
# File 'lib/ga_shikomi/config.rb', line 5 def initialize(file) @config = {} load(file) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/ga_shikomi/config.rb', line 10 def config @config end |
Instance Method Details
#load(file) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ga_shikomi/config.rb', line 12 def load(file) if File.exist? file @config = YAML.load_file(file) else raise FileNotFound, "config_file #{file}" end end |