Class: Ns::Api::Response::TravelAdvice

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/ns/api/response/travel_advice.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/travel_advice.rb', line 7

def parsed_response
  @parsed_response
end

Instance Method Details

#travel_optionsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ns/api/response/travel_advice.rb', line 9

def travel_options
  raw_travel_options.map do |travel_option|
    Ns::TravelOption.new(
      planned_departure: travel_option['GeplandeVertrekTijd'],
      actual_departure:  travel_option['ActueleVertrekTijd'],
      planned_arrival:   travel_option['GeplandeAankomstTijd'],
      actual_arrival:    travel_option['ActueleAankomstTijd'],
      changes:           travel_option['AantalOverstappen'],
      platform:          platform(travel_option),
      optimal:           travel_option['Optimaal']
    )
  end
end