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



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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/wcc/data/nucleus/campus.rb', line 12

def self.db
  [
    {
      id: 1,
      code: 'DAL',
      name: 'Dallas',
      key: :dallas,
      street: '7540 LBJ Freeway',
      city: 'Dallas',
      state: 'TX',
      zip: '75251',
      geo: [32.922923, -96.7781638]
    },
    {
      id: 2,
      code: 'FTW',
      name: 'Fort Worth',
      key: :ft_worth,
      street: '8000 Western Hills Blvd',
      city: 'Fort Worth',
      state: 'TX',
      zip: '76108',
      geo: [32.739972, -97.455414]
    },
    {
      id: 3,
      code: 'PLA',
      name: 'Plano',
      key: :plano,
      street: '6400 K Avenue',
      city: 'Plano',
      state: 'TX',
      zip: '75074',
      geo: [33.060823, -96.688902]
    },
    {
      id: 4,
      code: 'FRS',
      name: 'Frisco',
      key: :frisco,
      street: '6401 Parkwood Blvd',
      city: 'Frisco',
      state: 'TX',
      zip: '75034',
      geo: [33.130761, -96.822322]
    },
    {
      id: 5,
      code: 'SDL',
      name: 'South Dallas',
      key: :south_dallas,
      street: '3400 Garden Ln',
      city: 'Dallas',
      state: 'TX',
      zip: '75215',
      geo: [32.758418, -96.743966]
    }
  ]
end

Instance Method Details

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


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

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