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
- #car_composition_types ⇒ Object
- #has_one_car_composition_type? ⇒ Boolean
- #max_car_composition ⇒ Object
含まれている情報の判定 collapse
- #has_barrier_free_facility_infos? ⇒ Boolean
- #has_surrounding_area_infos? ⇒ Boolean
- #has_transfer_infos? ⇒ Boolean
含まれている情報 collapse
Instance Method Summary collapse
- #railway_line_css_class_name ⇒ Object
- #railway_line_name_en ⇒ Object
- #railway_line_name_ja ⇒ Object
- #tab_name ⇒ Object
Instance Method Details
#barrier_free_facility_infos ⇒ Object
59 60 61 62 63 |
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 59 def @platform_infos.map { | info | info..includes( :barrier_free_facility_located_area , :barrier_free_facility_type , :barrier_free_facility_service_details ) } end |
#car_composition_types ⇒ Object
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
45 46 47 |
# File 'lib/tokyo_metro/app/renderer/station_facility/platform/info/meta_class/common.rb', line 45 def @platform_infos.any? { | info | info..present? } end |
#has_one_car_composition_type? ⇒ 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
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
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
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_composition ⇒ Object
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_name ⇒ Object
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_en ⇒ Object
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_ja ⇒ Object
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_infos ⇒ Object
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_name ⇒ Object
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_infos ⇒ Object
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 |