10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/tokyo_metro/app/renderer/station_facility/platform.rb', line 10
def to_a
ary = ::Array.new
case @type_of_platform_infos
when :between_wakoshi_and_hikawadai
ary << ::TokyoMetro::App::Renderer::StationFacility::Platform::Info::BetweenWakoshiAndHikawadai::Whole.new(
request ,
@platform_infos_grouped_by_railway_line.values.first ,
::RailwayLine.where( id: railway_line_ids_of_platform_infos )
)
when :kotake_mukaihara
ary << ::TokyoMetro::App::Renderer::StationFacility::Platform::Info::KotakeMukaihara::Whole.new(
request ,
@platform_infos_grouped_by_railway_line.values.first ,
::RailwayLine.where( id: railway_line_ids_of_platform_infos )
)
when :meguro_and_shirokanedai
ary << ::TokyoMetro::App::Renderer::StationFacility::Platform::Info::MeguroAndShirokanedai::Whole.new(
request ,
@platform_infos_grouped_by_railway_line.values.first ,
::RailwayLine.where( same_as: [ "odpt.Railway:TokyoMetro.Namboku" , "odpt.Railway:Toei.Mita" ] ).order( :id )
)
when :shirokane_takanawa
ary << ::TokyoMetro::App::Renderer::StationFacility::Platform::Info::ShirokaneTakanawa::Whole.new(
request ,
@platform_infos_grouped_by_railway_line.values.first ,
::RailwayLine.where( same_as: [ "odpt.Railway:TokyoMetro.Namboku" , "odpt.Railway:Toei.Mita" ] ).order( :id )
)
when :normal
@platform_infos_grouped_by_railway_line.each do | railway_line_id , platform_infos |
ary << ::TokyoMetro::App::Renderer::StationFacility::Platform::Info::Normal::Whole.new(
request ,
platform_infos ,
::RailwayLine.find( railway_line_id )
)
end
end
::TokyoMetro::App::Renderer::StationFacility::Platform::List.new( @resuest , ary )
end
|