Sha256: 08bba386b4e8df1e9d74ad441517e57a2c6c17d8534027ec8e8923a89bd6ba7c

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

class TokyoMetro::App::Renderer::RealTimeInfos::SideMenu::LinksToRailwayLinePages < TokyoMetro::Factory::Decorate::MetaClass

  def initialize( request )
    super( request )
    @railway_lines = ::RailwayLine.tokyo_metro( including_branch_line: false )

    @controllers = {
      train_operation: {
        ja: ::TrainOperation::InfoDecorator.common_title_ja ,
        en: ::TrainOperation::InfoDecorator.common_title_en
      } ,
      train_location: {
        ja: ::TrainLocationDecorator.common_title_ja ,
        en: ::TrainLocationDecorator.common_title_en
      } ,
      railway_line: {
        ja: ::RailwayLineDecorator.common_title_ja ,
        en: ::RailwayLineDecorator.common_title_en
      }
    }
  end

  def render
    h.render inline: <<-HAML , type: :haml , locals: h_locals
%div{ id: :links_to_real_time_info_pages_of_railway_lines }
  %div{ class: :title }<
    %div{ class: :text_ja }<
      = "各路線のご案内"
    %div{ class: :text_en }<
      = "Pages related to railway lines"
  %ul{ id: :links_to_railway_line_pages , class: [ :links , :clearfix ] }
    - railway_lines.each do | railway_line |
      = ::TokyoMetro::App::Renderer::RealTimeInfos::SideMenu::LinkToRailwayLinePage.new( request , railway_line.decorate , controllers ).render
    HAML
  end

  private

  def h_locals
    super.merge({
      railway_lines: @railway_lines ,
      controllers: @controllers
    })
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/app/renderer/real_time_infos/side_menu/links_to_railway_line_pages.rb