Class: Tagomatic::SystemConfiguration
- Inherits:
-
Hash
- Object
- Hash
- Tagomatic::SystemConfiguration
show all
- Defined in:
- lib/tagomatic/system_configuration.rb
Defined Under Namespace
Classes: MetaHandler
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SystemConfiguration.
7
8
9
|
# File 'lib/tagomatic/system_configuration.rb', line 7
def initialize(&block)
instance_eval(&block) if block_given?
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *arguments) ⇒ Object
13
14
15
16
|
# File 'lib/tagomatic/system_configuration.rb', line 13
def method_missing(name, *arguments)
handler = MetaHandler.new(self, name)
handler.invoke(arguments)
end
|
Instance Method Details
#register(assignment_hash) ⇒ Object
23
24
25
26
27
28
|
# File 'lib/tagomatic/system_configuration.rb', line 23
def register(assignment_hash)
assignment_hash.each do |key, value|
key = key.to_sym
self[key] = value
end
end
|
#retrieve(key) ⇒ Object
18
19
20
21
|
# File 'lib/tagomatic/system_configuration.rb', line 18
def retrieve(key)
key = key.to_sym
self[key] || raise("global object #{key} not registered")
end
|
#super_method_missing ⇒ Object
11
|
# File 'lib/tagomatic/system_configuration.rb', line 11
alias :super_method_missing :method_missing
|