Module: PropertySets::PropertySetModel::InstanceMethods

Defined in:
lib/property_sets/property_set_model.rb

Instance Method Summary collapse

Instance Method Details

#disableObject



18
19
20
21
# File 'lib/property_sets/property_set_model.rb', line 18

def disable
  update_attribute(:value, "0")
  self
end

#enableObject



13
14
15
16
# File 'lib/property_sets/property_set_model.rb', line 13

def enable
  update_attribute(:value, "1")
  self
end

#false?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


23
24
25
# File 'lib/property_sets/property_set_model.rb', line 23

def protected?
  self.class.protected?(name.to_sym)
end

#to_sObject



27
28
29
# File 'lib/property_sets/property_set_model.rb', line 27

def to_s
  value.to_s
end

#true?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/property_sets/property_set_model.rb', line 9

def true?
  !false?
end