Class: Echelon::AltonTowers

Inherits:
Park
  • Object
show all
Defined in:
lib/echelon/parks/alton_towers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Park

#find_by_id, #find_by_name, #rides

Constructor Details

#initializeAltonTowers

Returns a new instance of AltonTowers.



25
26
27
28
29
30
31
32
33
34
# File 'lib/echelon/parks/alton_towers.rb', line 25

def initialize
  # fetch the json feed from the merlin site
  url = 'http://www.merlincms.com/2.php'
  resp = Net::HTTP.get_response(URI.parse(url))
  data = resp.body

  # were only interested in the ride data, throw everything else away
  json_data = JSON.parse(data)
  @json_data = json_data['Rides']
end

Instance Attribute Details

#json_dataObject (readonly)

Returns the value of attribute json_data.



8
9
10
# File 'lib/echelon/parks/alton_towers.rb', line 8

def json_data
  @json_data
end

Instance Method Details

#ride_listObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/echelon/parks/alton_towers.rb', line 10

def ride_list
  {
    1 => 'Air',
    2 => 'Nemesis',
    3 => 'TH13TEEN',
    6 => 'Oblivion',
    8 => 'Rita',
    10 => 'Congo River Rapids',
    11 => 'Sonic Spinball',
    14 => 'Runaway Mine Train',
    15 => 'The Flume',
    31 => 'Nemesis Sub-Terra'
  }
end