Class: MetaCommit::Configuration
- Inherits:
-
Hash
- Object
- Hash
- MetaCommit::Configuration
- Defined in:
- lib/meta_commit/configuration.rb
Instance Method Summary collapse
-
#fill_from_hash(hash) ⇒ MetaCommit::Configuration
Fill config values from yaml file.
-
#fill_from_yaml_file(path) ⇒ MetaCommit::Configuration
Fill config values from yaml file.
-
#get(key) ⇒ Object
Get the configuration value by key.
-
#set(key, value) ⇒ Object
Set the configuration key.
Instance Method Details
#fill_from_hash(hash) ⇒ MetaCommit::Configuration
Fill config values from yaml file
21 22 23 24 |
# File 'lib/meta_commit/configuration.rb', line 21 def fill_from_hash(hash) hash.each {|key, value| set(key.to_sym, value)} self end |
#fill_from_yaml_file(path) ⇒ MetaCommit::Configuration
Fill config values from yaml file
29 30 31 |
# File 'lib/meta_commit/configuration.rb', line 29 def fill_from_yaml_file(path) fill_from_hash read_from_yaml(path) end |
#get(key) ⇒ Object
Get the configuration value by key
14 15 16 |
# File 'lib/meta_commit/configuration.rb', line 14 def get(key) self[key] end |
#set(key, value) ⇒ Object
Set the configuration key
7 8 9 |
# File 'lib/meta_commit/configuration.rb', line 7 def set(key, value) self[key] = value end |