Class: FigTree::ConfigValue
- Inherits:
-
Struct
- Object
- Struct
- FigTree::ConfigValue
- Defined in:
- lib/fig_tree.rb
Instance Attribute Summary collapse
-
#default_proc ⇒ Object
Returns the value of attribute default_proc.
-
#default_value ⇒ Object
Returns the value of attribute default_value.
-
#deprecation ⇒ Object
Returns the value of attribute deprecation.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#clone_and_reset ⇒ Object
:nodoc:.
-
#reset! ⇒ Object
Reset value back to default.
Instance Attribute Details
#default_proc ⇒ Object
Returns the value of attribute default_proc
14 15 16 |
# File 'lib/fig_tree.rb', line 14 def default_proc @default_proc end |
#default_value ⇒ Object
Returns the value of attribute default_value
14 15 16 |
# File 'lib/fig_tree.rb', line 14 def default_value @default_value end |
#deprecation ⇒ Object
Returns the value of attribute deprecation
14 15 16 |
# File 'lib/fig_tree.rb', line 14 def deprecation @deprecation end |
#value ⇒ Object
Returns the value of attribute value
14 15 16 |
# File 'lib/fig_tree.rb', line 14 def value @value end |
Instance Method Details
#clone_and_reset ⇒ Object
:nodoc:
26 27 28 29 30 31 |
# File 'lib/fig_tree.rb', line 26 def clone_and_reset setting = ConfigValue.new(self.value, self.default_value, self.default_proc, self.deprecation) setting.reset! setting end |
#reset! ⇒ Object
Reset value back to default.
17 18 19 20 21 22 23 |
# File 'lib/fig_tree.rb', line 17 def reset! if self.value.is_a?(ConfigStruct) self.value.reset! else self.value = self.default_value end end |