Class: TokyoMetro::App::Renderer::StationMatrix
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::StationMatrix
- Defined in:
- lib/tokyo_metro/app/renderer/station_matrix.rb
Overview
駅一覧表(路線別)を作成するためのクラス
Instance Method Summary collapse
-
#initialize(request, railway_lines, make_link_to_railway_line: false, type_of_link_to_station: nil, set_anchor: false) ⇒ StationMatrix
constructor
A new instance of StationMatrix.
- #render ⇒ Object
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
#render ⇒ Object
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 |