Module: TokyoMetro::App::Renderer::StationFacility::Platform::Info::MetaClass::Common

Included in:
EachDirection, Whole
Defined in:
lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb

方面別の情報 collapse

車両編成の情報 collapse

含まれている情報の判定 collapse

含まれている情報 collapse

Instance Method Summary collapse

Instance Method Details

#barrier_free_facility_infosObject



59
60
61
62
63
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 59

def barrier_free_facility_infos
  @platform_infos.map { | info |
    info.barrier_free_facility_infos.includes( :barrier_free_facility_located_area , :barrier_free_facility_type , :barrier_free_facility_service_details )
  }
end

#car_composition_typesObject



27
28
29
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 27

def car_composition_types
  @platform_infos.map( &:car_composition ).uniq
end

#has_barrier_free_facility_infos?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 45

def has_barrier_free_facility_infos?
  @platform_infos.any? { | info | info.barrier_free_facility_infos.present? }
end

#has_one_car_composition_type?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 31

def has_one_car_composition_type?
  car_composition_types.length == 1
end

#has_railway_direction_infos?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 21

def has_railway_direction_infos?
  @platform_infos.any? { | info | info.railway_direction_id.present? }
end

#has_surrounding_area_infos?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 49

def has_surrounding_area_infos?
  @platform_infos.any? { | info | info.surrounding_areas.present? }
end

#has_transfer_infos?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 41

def has_transfer_infos?
  @platform_infos.any? { | info | info.station_facility_platform_info_transfer_infos.present? }
end

#max_car_compositionObject



35
36
37
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 35

def max_car_composition
  car_composition_types.max
end

#railway_line_css_class_nameObject



11
12
13
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 11

def railway_line_css_class_name
  raise "Error: The method \'#{ __method__ }\' is not defined yet in this class."
end

#railway_line_name_enObject



7
8
9
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 7

def railway_line_name_en
  raise "Error: The method \'#{ __method__ }\' is not defined yet in this class."
end

#railway_line_name_jaObject



3
4
5
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 3

def railway_line_name_ja
  raise "Error: The method \'#{ __method__ }\' is not defined yet in this class."
end

#surrounding_area_infosObject



65
66
67
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 65

def surrounding_area_infos
  @platform_infos.map( &:surrounding_areas )
end

#tab_nameObject



15
16
17
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 15

def tab_name
  "platform_info_#{ railway_line_css_class_name }_line"
end

#transfer_infosObject



55
56
57
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 55

def transfer_infos
  @platform_infos.map( &:station_facility_platform_info_transfer_infos )
end