Class: Echelon::ThorpePark

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Park

#find_by_id, #find_by_name, #rides

Constructor Details

#initializeThorpePark

Returns a new instance of ThorpePark.



42
43
44
45
46
47
48
49
50
51
# File 'lib/echelon/parks/thorpe_park.rb', line 42

def initialize
  # fetch the json feed from the merlin site
  url = 'http://www.merlincms.com/1.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/thorpe_park.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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/echelon/parks/thorpe_park.rb', line 10

def ride_list
  {
    1 => 'SAW - The Ride',
    3 => 'Stealth',
    4 => 'Colossus',
    5 => 'Detonator',
    6 => 'Nemesis Inferno',
    7 => 'Rush',
    8 => 'Samurai',
    9 => 'Slammer',
    10 => 'Tidal Wave',
    11 => 'Vortex',
    12 => 'X:\No Way Out',
    13 => 'Time Voyagers',
    14 => 'Quantum',
    15 => 'Loggers Leap',
    16 => 'Flying Fish',
    17 => 'Rumba Rapids',
    18 => 'Zodiac',
    19 => 'Depth Charge',
    20 => 'SAW Alive',
    21 => 'Mr. Monkey\'s Banana Ride',
    22 => 'Storm in a Teacup',
    23 => 'Rocky Express',
    24 => 'Wet Wet Wet',
    25 => 'Neptune\'s Beach',
    26 => 'Chief Ranger\'s Carousel',
    27 => 'Storm Surge',
    28 => 'The Swarm'
  }
end