Class: TokyoMetro::App::Renderer::WomenOnlyCarInfo

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

Defined Under Namespace

Classes: EachRailwayLine, Header

Instance Method Summary collapse

Constructor Details

#initialize(request, railway_lines) ⇒ WomenOnlyCarInfo

Returns a new instance of WomenOnlyCarInfo.



3
4
5
6
7
# File 'lib/tokyo_metro/app/renderer/women_only_car_info.rb', line 3

def initialize( request , railway_lines )
  super( request )
  @railway_lines = railway_lines
  set_infos
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tokyo_metro/app/renderer/women_only_car_info.rb', line 9

def render
  if @infos.present?
    h.render inline: <<-HAML , type: :haml , locals: h_locals
%div{ id: :women_only_car }
= ::TokyoMetro::App::Renderer::WomenOnlyCarInfo::Header.new( request ).render
- if infos.length > 1
  - infos.each do | infos_of_a_railway_line |
    = infos_of_a_railway_line.render( display_railway_line: true )
- else
  = infos.first.render
    HAML
  end
end