Class: Burek::BurekConfiguration
- Inherits:
-
Object
- Object
- Burek::BurekConfiguration
show all
- Defined in:
- lib/config.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BurekConfiguration.
6
7
8
|
# File 'lib/config.rb', line 6
def initialize(hash)
@hash = hash
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
18
19
20
21
22
|
# File 'lib/config.rb', line 18
def method_missing(m, *args, &block)
key = m.to_s.gsub('=','').to_sym
raise 'Unknown config key!' unless @hash.has_key? key
@hash[key] = args.first
end
|
Instance Method Details
#get(key) ⇒ Object
14
15
16
|
# File 'lib/config.rb', line 14
def get(key)
hash[key]
end
|
#hash ⇒ Object
10
11
12
|
# File 'lib/config.rb', line 10
def hash
@hash
end
|