Class: CdCriterion

Inherits:
Sequel::Model
  • Object
show all
Defined in:
model/criteria.rb

Constant Summary collapse

PRESENT_YES =
'present'
PRESENT_NO =
'absent'
PRESENT_CANT_SAY =
'cant_say'
PRESENCE_VALID =
[PRESENT_YES, PRESENT_NO, PRESENT_CANT_SAY]
NAMES =
{  PRESENT_YES       =>"criteria.present",
         PRESENT_NO        =>"criteria.absent",
         PRESENT_CANT_SAY  =>"criteria.cant_say"
}
PRESENT_LIST =
[PRESENT_YES, PRESENT_NO, PRESENT_CANT_SAY]

Class Method Summary collapse

Class Method Details

.get_name_present(x) ⇒ Object



71
72
73
# File 'model/criteria.rb', line 71

def self.get_name_present(x)
  x.nil? ? "criteria.no_data" : NAMES[x]
end

.valid_presence?(x) ⇒ Boolean

Returns:

  • (Boolean)


74
75
76
# File 'model/criteria.rb', line 74

def self.valid_presence?(x)
  PRESENCE_VALID.include? x.to_s
end