Class: TokyoMetro::App::Renderer::StationTimetable::Group::EachRailwayLine::EachRailwayDirection::EachOperationDay
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::StationTimetable::Group::EachRailwayLine::EachRailwayDirection::EachOperationDay
- Defined in:
- lib/tokyo_metro/app/renderer/station_timetable/group/each_railway_line/each_direction/each_operation_day.rb
Overview
個別の時刻表(路線・方面・運行日別)を作成するためのクラス
Defined Under Namespace
Classes: StationTrainTimes
Instance Attribute Summary collapse
-
#station_train_times ⇒ Object
readonly
Returns the value of attribute station_train_times.
Instance Method Summary collapse
-
#initialize(request, station_info, railway_line, railway_direction, operation_day, station_train_times) ⇒ EachOperationDay
constructor
Constructor.
- #render ⇒ Object
- #render_header ⇒ Object
Constructor Details
#initialize(request, station_info, railway_line, railway_direction, operation_day, station_train_times) ⇒ EachOperationDay
Constructor
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tokyo_metro/app/renderer/station_timetable/group/each_railway_line/each_direction/each_operation_day.rb', line 10 def initialize( request , station_info , railway_line , railway_direction , operation_day , station_train_times ) super( request ) @station_info = station_info @railway_line = railway_line @railway_direction = railway_direction @operation_day = operation_day set_valid_station_info @station_train_times = ::TokyoMetro::App::Renderer::StationTimetable::Group::EachRailwayLine::EachRailwayDirection::EachOperationDay::StationTrainTimes.new( station_train_times ) end |
Instance Attribute Details
#station_train_times ⇒ Object (readonly)
Returns the value of attribute station_train_times.
22 23 24 |
# File 'lib/tokyo_metro/app/renderer/station_timetable/group/each_railway_line/each_direction/each_operation_day.rb', line 22 def station_train_times @station_train_times end |
Instance Method Details
#render ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/tokyo_metro/app/renderer/station_timetable/group/each_railway_line/each_direction/each_operation_day.rb', line 24 def render h.render inline: <<-HAML , type: :haml , locals: h_locals %table{ class: [ :station_timetable , operation_day.decorate.css_class_name ] } = this.render_header = this.station_train_times.render_body HAML end |
#render_header ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/tokyo_metro/app/renderer/station_timetable/group/each_railway_line/each_direction/each_operation_day.rb', line 32 def render_header h.render inline: <<-HAML , type: :haml , locals: h_locals %thead{ class: railway_line.css_class_name } %tr %td{ colspan: 2 , class: :top_header } = railway_line.decorate.render_in_station_timetable_header %div{ class: :main } = operation_day.decorate.render_in_station_timetable_header = railway_direction.decorate.render_in_station_timetable_header - if station_info.present? = station_info.decorate.render_in_station_timetable_header = station_train_times.render_message_in_header HAML end |