Class: Castor::Configuration::Node
- Inherits:
-
Object
- Object
- Castor::Configuration::Node
- Defined in:
- lib/castor/configuration/node.rb
Instance Method Summary collapse
-
#initialize(name, block) ⇒ Node
constructor
A new instance of Node.
- #value ⇒ Object
- #value=(new_value) ⇒ Object
Constructor Details
#initialize(name, block) ⇒ Node
Returns a new instance of Node.
4 5 6 7 8 |
# File 'lib/castor/configuration/node.rb', line 4 def initialize(name, block) @name = name instance_eval(&block) self.value = @default end |
Instance Method Details
#value ⇒ Object
16 17 18 |
# File 'lib/castor/configuration/node.rb', line 16 def value lazy? ? lazy_value : @value end |
#value=(new_value) ⇒ Object
10 11 12 13 14 |
# File 'lib/castor/configuration/node.rb', line 10 def value=(new_value) if validate!(new_value) @value = new_value end end |