Class: Ns::Api::Response::DisruptionCollection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize

Instance Attribute Details

#parsed_responseObject

Returns the value of attribute parsed_response.



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

def parsed_response
  @parsed_response
end

Instance Method Details

#planned_disruptionsObject



9
10
11
12
13
# File 'lib/ns/api/response/disruption_collection.rb', line 9

def planned_disruptions
  ( raw_disruptions['Gepland'] || [] ).map do |raw_disruption|
    new_disruption(raw_disruption)
  end.flatten.compact
end

#unplanned_disruptionsObject



15
16
17
18
19
# File 'lib/ns/api/response/disruption_collection.rb', line 15

def unplanned_disruptions
  ( raw_disruptions['Ongepland'] || [] ).map do |raw_disruption|
    new_disruption(raw_disruption)
  end.flatten.compact
end