Class: TokyoMetro::App::Renderer::Concerns::Link::ToRailwayLinePage::MetaClass

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/concerns/link/to_railway_line_page/meta_class.rb

Direct Known Subclasses

Fare, FromStationFacilityPage, Group

Defined Under Namespace

Classes: Group

Instance Method Summary collapse

Constructor Details

#initialize(request, railway_line_decorated) ⇒ MetaClass

Returns a new instance of MetaClass.



3
4
5
6
7
8
# File 'lib/tokyo_metro/app/renderer/concerns/link/to_railway_line_page/meta_class.rb', line 3

def initialize( request , railway_line_decorated )
  super( request )
  @railway_line_decorated = railway_line_decorated
  @small_railway_line_code = true
  raise unless valid_railway_line_decorator_class?
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tokyo_metro/app/renderer/concerns/link/to_railway_line_page/meta_class.rb', line 10

def render
  if to_render?
    h.render inline: <<-HAML , type: :haml , locals: h_locals
%li{ class: li_classes }
- if url.present?
  = link_to_unless( without_link_to_railway_line_page , "" , url )
%div{ class: div_classes }
  = railway_line_decorated.render_railway_line_code( small: small_railway_line_code )
  = railway_line_decorated.render_name( prefix_ja: prefix_ja , prefix_en: prefix_en , suffix_ja: suffix_ja , suffix_en: suffix_en )
  - if optional_infos_to_display.present?
    - [ optional_infos_to_display ].flatten.each do | info |
      = info.call
    HAML
  end
end