Class: ConfigManager::Item
- Inherits:
-
Object
- Object
- ConfigManager::Item
- Defined in:
- app/models/config_manager.rb
Constant Summary collapse
- VALID_TYPES =
[:boolean, :integer, :string, :text].freeze
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.
79 80 81 |
# File 'app/models/config_manager.rb', line 79 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
79 80 81 |
# File 'app/models/config_manager.rb', line 79 def name @name end |
#ruby_type ⇒ Object
Returns the value of attribute ruby_type.
79 80 81 |
# File 'app/models/config_manager.rb', line 79 def ruby_type @ruby_type end |
Instance Method Details
#canonicalize(value) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'app/models/config_manager.rb', line 81 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, :text value.to_s end end |