Class: Transilien::VehicleJourney
Constant Summary
Constants inherited
from MicroService
MicroService::API_HOST, MicroService::API_URI, MicroService::Default_cache_duration
Instance Attribute Summary
Attributes inherited from MicroService
#access_time, #external_code, #name, #payload
Instance Method Summary
collapse
action, action_component, action_instance_xpath, action_param, add_filters, cache_it, cache_keys, errors, filters, filters=, find, find_from_full_query_cache, find_from_query_caches, from_node, http, params, #to_s
Instance Method Details
#company ⇒ Object
8
9
10
|
# File 'lib/transilien/vehicle_journey.rb', line 8
def company
@company ||= Transilien::Company.from_node(payload.at('Company'), access_time)
end
|
#mode ⇒ Object
5
6
7
|
# File 'lib/transilien/vehicle_journey.rb', line 5
def mode
@mode ||= Transilien::Mode.from_node(payload.at('Mode'), access_time)
end
|
#route ⇒ Object
2
3
4
|
# File 'lib/transilien/vehicle_journey.rb', line 2
def route
@route ||= Transilien::Route.from_node(payload.at('Route'), access_time)
end
|
#stops ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/transilien/vehicle_journey.rb', line 18
def stops
@stops ||= begin
stops_nodes = payload.at('StopList')
stops_nodes.children.map do |stop_node|
Transilien::Stop.from_node(stop_node, access_time)
end
end
end
|
#validity_pattern ⇒ Object
14
15
16
|
# File 'lib/transilien/vehicle_journey.rb', line 14
def validity_pattern
@validity_pattern ||= payload.at('ValidityPattern')
end
|
#vehicle ⇒ Object
11
12
13
|
# File 'lib/transilien/vehicle_journey.rb', line 11
def vehicle
@vehicle ||= payload.at('Vehicle')
end
|