Class: Nutella::ConfigHash
- Inherits:
-
Object
- Object
- Nutella::ConfigHash
- Defined in:
- lib/config/config.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
- #empty? ⇒ Boolean
- #has_key?(key) ⇒ Boolean
-
#initialize(file) ⇒ ConfigHash
constructor
A new instance of ConfigHash.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file) ⇒ ConfigHash
Returns a new instance of ConfigHash.
9 10 11 |
# File 'lib/config/config.rb', line 9 def initialize(file) @config_file=file end |
Instance Method Details
#[](key) ⇒ Object
20 21 22 23 |
# File 'lib/config/config.rb', line 20 def [](key) hash = loadConfig hash[key] end |
#[]=(key, val) ⇒ Object
14 15 16 17 18 |
# File 'lib/config/config.rb', line 14 def []=(key,val) hash = loadConfig hash[key]=val storeConfig hash end |
#empty? ⇒ Boolean
25 26 27 28 |
# File 'lib/config/config.rb', line 25 def empty? hash = loadConfig hash.empty? end |
#has_key?(key) ⇒ Boolean
30 31 32 33 |
# File 'lib/config/config.rb', line 30 def has_key?(key) hash = loadConfig hash.has_key? key end |
#to_h ⇒ Object
40 41 42 43 |
# File 'lib/config/config.rb', line 40 def to_h hash = loadConfig hash end |
#to_s ⇒ Object
35 36 37 38 |
# File 'lib/config/config.rb', line 35 def to_s hash = loadConfig hash.to_s end |