Class: TokyoMetro::App::Renderer::WomenOnlyCarInfo
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::WomenOnlyCarInfo
- Defined in:
- lib/tokyo_metro/app/renderer/women_only_car_info.rb
Defined Under Namespace
Classes: EachRailwayLine, Header
Instance Method Summary collapse
-
#initialize(request, railway_lines) ⇒ WomenOnlyCarInfo
constructor
A new instance of WomenOnlyCarInfo.
- #render ⇒ Object
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
#render ⇒ Object
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 |