Class: Ns::DisruptionCollection

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/ns/disruption_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize

Instance Attribute Details

#actualObject

If actual=true, the unplanned disruptions are returned, as well as the planned disruptions (due to maintenance) that will occur within two hours of the request.



20
21
22
# File 'lib/ns/disruption_collection.rb', line 20

def actual
  @actual
end

#include_plannedObject

For some reason NS has decided that passing “unplanned=true” will return the planned disruptions. We pass a default value of unplanned=false so planned disruptions don’t show up by default.



30
31
32
# File 'lib/ns/disruption_collection.rb', line 30

def include_planned
  @include_planned
end

#stationObject

Returns the value of attribute station.



5
6
7
# File 'lib/ns/disruption_collection.rb', line 5

def station
  @station
end

Instance Method Details

#planned_disruptionsObject



7
8
9
# File 'lib/ns/disruption_collection.rb', line 7

def planned_disruptions
  @planned_disruptions ||= response.planned_disruptions
end

#unplanned_disruptionsObject



11
12
13
# File 'lib/ns/disruption_collection.rb', line 11

def unplanned_disruptions
  @planned_disruptions ||= response.unplanned_disruptions
end