Class: Insulin::Config
- Inherits:
-
Hash
- Object
- Hash
- Insulin::Config
- Defined in:
- lib/insulin/config.rb
Overview
This class is a simple wrapper around a YAML config file
Instance Method Summary collapse
-
#get_section(section) ⇒ Object
Return a particular section (as a hash).
-
#initialize(path = nil) ⇒ Config
constructor
Open the file at ‘path’.
Constructor Details
#initialize(path = nil) ⇒ Config
Open the file at ‘path’. If no path is provided, go to default
9 10 11 12 13 14 |
# File 'lib/insulin/config.rb', line 9 def initialize path = nil if not path path = "conf/insulin.yaml" end self.update YAML.load File.open path end |
Instance Method Details
#get_section(section) ⇒ Object
Return a particular section (as a hash)
17 18 19 |
# File 'lib/insulin/config.rb', line 17 def get_section section return self[section] end |