Sha256: 0b2fb720b807183e8f442b77507c4d63d9ecea45877655b2f9025987b32e653e

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# 駅一覧表(路線別)を作成するためのクラス
class TokyoMetro::App::Renderer::StationMatrix < TokyoMetro::Factory::Decorate::MetaClass

  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

  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

  private

  def h_locals
    super.merge({
      railway_lines: @railway_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

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/app/renderer/station_matrix.rb