Class: TokyoMetro::App::Renderer::StationMatrix

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/station_matrix.rb

Overview

駅一覧表(路線別)を作成するためのクラス

Instance Method Summary collapse

Constructor Details

#initialize(request, railway_lines, make_link_to_railway_line: false, type_of_link_to_station: nil, set_anchor: false) ⇒ StationMatrix

Returns a new instance of StationMatrix.



4
5
6
7
8
9
10
# File 'lib/tokyo_metro/app/renderer/station_matrix.rb', line 4

def initialize( request , railway_lines , make_link_to_railway_line: false , type_of_link_to_station: nil , set_anchor: false )
  super( request )
  @railway_lines = railway_lines.except_for_branch_lines
  @make_link_to_railway_line = make_link_to_railway_line
  @type_of_link_to_station = type_of_link_to_station
  @set_anchor = set_anchor
end

Instance Method Details

#renderObject



12
13
14
15
16
17
18
19
# File 'lib/tokyo_metro/app/renderer/station_matrix.rb', line 12

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
= ::TokyoMetro::App::Renderer::Concerns::Header::Selection.station_from_railway_line( request ).render
%div{ id: :station_matrixes }
- railway_lines.each do | railway_line |
  = railway_line.decorate.render_matrix_and_links_to_stations( make_link_to_railway_line , type_of_link_to_station , set_anchor )
  HAML
end