Class: TokyoMetro::App::Renderer::TravelTimeInfo::MetaClass::Row::Station

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/travel_time_info/meta_class/row/station.rb

Defined Under Namespace

Classes: LinkToRailwayLinePage

Instance Method Summary collapse

Constructor Details

#initialize(request, station_info, left_columns, columns_next_to_railway_line, right_columns, additional_info_left_on_station, additional_info_next_to_railway_on_station, additional_info_right_on_station) ⇒ Station

Returns a new instance of Station.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/tokyo_metro/app/renderer/travel_time_info/meta_class/row/station.rb', line 3

def initialize( request , station_info ,
  left_columns , columns_next_to_railway_line , right_columns ,
  additional_info_left_on_station , additional_info_next_to_railway_on_station , additional_info_right_on_station
)
  super( request )
  @station_info = station_info

  @left_columns = left_columns
  @columns_next_to_railway_line = columns_next_to_railway_line
  @right_columns = right_columns

  @additional_info_left_on_station = additional_info_left_on_station
  @additional_info_next_to_railway_on_station = additional_info_next_to_railway_on_station
  @additional_info_right_on_station = additional_info_right_on_station
end

Instance Method Details

#renderObject



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
# File 'lib/tokyo_metro/app/renderer/travel_time_info/meta_class/row/station.rb', line 19

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
- station_info_decorated = station_info.decorate

%tr{ class: :station_info_row }

- if additional_info_left_on_station.present? and additional_info_left_on_station.has_procedure_of?( station_info )
  = additional_info_left_on_station.render( station_info )
- elsif left_columns > 1
  %td{ class: :transfer , colspan: left_columns }
    = station_info_decorated.render_connecting_railway_lines_in_travel_time_infos
- else
  %td{ class: :transfer }
    = station_info_decorated.render_connecting_railway_lines_in_travel_time_infos

- if columns_next_to_railway_line > 0 and additional_info_next_to_railway_on_station.present? and additional_info_next_to_railway_on_station.has_procedure_of?( station_info )
  = additional_info_next_to_railway_on_station.render( station_info )
- elsif columns_next_to_railway_line == 1
  %td<
    = " "
- elsif columns_next_to_railway_line > 1
  %td{ colspan: columns_next_to_railway_line }<
    = " "

%td{ class: :railway_line_column }<
  %div{ class: :travel_time_info_square }<
    = " "

- if additional_info_right_on_station.present? and additional_info_right_on_station.has_procedure_of?( station_info )
  = additional_info_right_on_station.render( station_info )
- elsif right_columns > 1
  %td{ class: :station_info , colspan: right_columns }
    = station_info_decorated.render_name_in_travel_time_infos
- else
  %td{ class: :station_info }
    = station_info_decorated.render_name_in_travel_time_infos
  HAML
end