Class: WCC::Data::Nucleus::Gender

Inherits:
EnumeratedType show all
Defined in:
lib/wcc/data/nucleus/gender.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from EnumeratedType

[], all, #initialize, reset

Constructor Details

This class inherits a constructor from WCC::Data::EnumeratedType

Class Method Details

.dbObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/wcc/data/nucleus/gender.rb', line 10

def self.db
  [
    {
      id: 1,
      name: 'Male',
      key: :male,
    },
    {
      id: 2,
      name: 'Female',
      key: :female,
    },
  ]
end

Instance Method Details

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/wcc/data/nucleus/gender.rb', line 6

def matches?(value)
  [id, key].include?(value)
end