Class: WCC::Data::Nucleus::Campus

Inherits:
EnumeratedType show all
Defined in:
lib/wcc/data/nucleus/campus.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



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/wcc/data/nucleus/campus.rb', line 11

def self.db
  [
    {
      id: 1,
      name: 'Dallas',
      key: :dallas,
      street: '7540 LBJ Freeway',
      city: 'Dallas',
      state: 'TX',
      zip: '75251',
      geo: [32.922923, -96.7781638],
    },
    {
      id: 2,
      name: 'Fort Worth',
      key: :ft_worth,
      street: '3345 Winthrop Avenue',
      city: 'Fort Worth',
      state: 'TX',
      zip: '76116',
      geo: [32.7280064, -97.4146727],
    },
    {
      id: 3,
      name: 'Plano',
      key: :plano,
      street: '6400 K Avenue',
      city: 'Plano',
      state: 'TX',
      zip: '75074',
      geo: [33.060823, -96.688902],
    },
  ]
end

Instance Method Details

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/wcc/data/nucleus/campus.rb', line 7

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