Module: PropertySets::PropertySetModel::InstanceMethods
- Defined in:
- lib/property_sets/property_set_model.rb
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
- #false? ⇒ Boolean
- #protected? ⇒ Boolean
- #to_s ⇒ Object
- #true? ⇒ Boolean
Instance Method Details
#disable ⇒ Object
18 19 20 21 |
# File 'lib/property_sets/property_set_model.rb', line 18 def disable update_attribute(:value, "0") self end |
#enable ⇒ Object
13 14 15 16 |
# File 'lib/property_sets/property_set_model.rb', line 13 def enable update_attribute(:value, "1") self end |
#false? ⇒ Boolean
5 6 7 |
# File 'lib/property_sets/property_set_model.rb', line 5 def false? [ "false", "0", "", "off", "n" ].member?(value.to_s.downcase) end |
#protected? ⇒ Boolean
23 24 25 |
# File 'lib/property_sets/property_set_model.rb', line 23 def protected? self.class.protected?(name.to_sym) end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/property_sets/property_set_model.rb', line 27 def to_s value.to_s end |
#true? ⇒ Boolean
9 10 11 |
# File 'lib/property_sets/property_set_model.rb', line 9 def true? !false? end |