Module: DVB

Defined in:
lib/dvb.rb,
lib/dvb/monitor.rb,
lib/dvb/version.rb

Defined Under Namespace

Classes: Departure

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.monitor(stop, offset = 0, lim = 0, city = 'Dresden') ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/dvb/monitor.rb', line 6

def self.monitor(stop, offset = 0, lim = 0, city = 'Dresden')
  response = RestClient.get 'http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do',
    { params: {
      ort: city,
      hst: stop,
      vz: offset,
      lim: lim
    }}
  JSON.parse(response.to_str).map { |e| Departure.new(e) }
end