Class: TokyoMetro::App::Renderer::TravelTimeInfo::MetaClass::ThroughOperation
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::TravelTimeInfo::MetaClass::ThroughOperation
- Includes:
- Columns
- Defined in:
- lib/tokyo_metro/app/renderer/travel_time_info/meta_class/through_operation.rb
Direct Known Subclasses
RailwayLine::ChiyodaLine::Bottom, RailwayLine::ChiyodaLine::Top, RailwayLine::FukutoshinLine::Bottom, RailwayLine::HanzomonLine::Bottom, RailwayLine::HanzomonLine::Top, RailwayLine::HibiyaLine::Bottom, RailwayLine::NambokuLine::Bottom, RailwayLine::NambokuLine::Top, RailwayLine::TozaiLine::Bottom, RailwayLine::TozaiLine::Top, RailwayLine::YurakuchoAndFukutoshinLine::Top
Defined Under Namespace
Classes: EachType
Instance Method Summary collapse
-
#initialize(request, left_columns, columns_next_to_railway_line, right_columns) ⇒ ThroughOperation
constructor
A new instance of ThroughOperation.
- #render ⇒ Object
Methods included from Columns
Constructor Details
#initialize(request, left_columns, columns_next_to_railway_line, right_columns) ⇒ ThroughOperation
Returns a new instance of ThroughOperation.
3 4 5 6 7 8 |
# File 'lib/tokyo_metro/app/renderer/travel_time_info/meta_class/through_operation.rb', line 3 def initialize( request , left_columns , columns_next_to_railway_line , right_columns ) super( request ) @left_columns = left_columns @columns_next_to_railway_line = columns_next_to_railway_line @right_columns = right_columns end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/tokyo_metro/app/renderer/travel_time_info/meta_class/through_operation.rb', line 12 def render h.render inline: <<-HAML , type: :haml , locals: h_locals %tr{ class: [ :through_operation_info_row , position ] }< - if left_columns > 1 and ary.present? %td{ class: :through_operation_infos , colspan: left_columns }< - if ary.length == 1 = ary.first.render - else - ary.each do | through_operation_type | = through_operation_type.render - elsif ary.present? %td{ class: :through_operation_infos }< - if ary.length == 1 = ary.first.render - else - ary.each do | through_operation_type | = through_operation_type.render - elsif left_columns > 1 %td{ class: :through_operation_infos , colspan: left_columns }< = " " - if columns_next_to_railway_line == 1 %td{ class: :through_operation_infos }< = " " - elsif columns_next_to_railway_line > 1 %td{ class: :through_operation_infos , colspan: columns_next_to_railway_line }< = " " %td{ class: [ :railway_line_column , class_name ] }< - if right_columns > 1 %td{ colspan: right_columns }< = " " - else %td< = " " HAML end |