Class: Configgler::Config::ConfigElement
- Inherits:
-
Object
- Object
- Configgler::Config::ConfigElement
- Defined in:
- lib/configgler/config.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
Instance Method Summary collapse
-
#initialize(config, element) ⇒ ConfigElement
constructor
A new instance of ConfigElement.
- #method_missing(name) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(config, element) ⇒ ConfigElement
Returns a new instance of ConfigElement.
34 35 36 37 |
# File 'lib/configgler/config.rb', line 34 def initialize(config,element) @element = config[element.to_s] self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
39 40 41 42 |
# File 'lib/configgler/config.rb', line 39 def method_missing(name) el = ConfigElement.new(@element,name.to_s) el.is_a?(Hash) ? el : el.value end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
32 33 34 |
# File 'lib/configgler/config.rb', line 32 def element @element end |
Instance Method Details
#value ⇒ Object
44 45 46 |
# File 'lib/configgler/config.rb', line 44 def value @element end |