Class: FigTree::ConfigValue

Inherits:
Struct
  • Object
show all
Defined in:
lib/fig_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_procObject

Returns the value of attribute default_proc



14
15
16
# File 'lib/fig_tree.rb', line 14

def default_proc
  @default_proc
end

#default_valueObject

Returns the value of attribute default_value



14
15
16
# File 'lib/fig_tree.rb', line 14

def default_value
  @default_value
end

#deprecationObject

Returns the value of attribute deprecation



14
15
16
# File 'lib/fig_tree.rb', line 14

def deprecation
  @deprecation
end

#valueObject

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_resetObject

: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