Class: ConfigManager::Item
- Inherits:
-
Object
- Object
- ConfigManager::Item
- Defined in:
- lib/config_manager.rb
Overview
Class Item. Manager an item save with his type, the default value and his name
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ruby_type ⇒ Object
Returns the value of attribute ruby_type.
Instance Method Summary collapse
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
73 74 75 |
# File 'lib/config_manager.rb', line 73 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
73 74 75 |
# File 'lib/config_manager.rb', line 73 def name @name end |
#ruby_type ⇒ Object
Returns the value of attribute ruby_type.
73 74 75 |
# File 'lib/config_manager.rb', line 73 def ruby_type @ruby_type end |
Instance Method Details
#canonicalize(value) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/config_manager.rb', line 75 def canonicalize(value) case ruby_type when :boolean case value when "0", 0, '', false, "false", "f", nil false else true end when :integer value.to_i when :string value.to_s when :yaml value.to_yaml else value end end |