class TokyoMetro::App::Renderer::FareTable::ToEachRailwayLine::Rows

Public Class Methods

new( request , station_infos , fares , normal_fare_groups , to_make_empty_row_when_no_station: false ) click to toggle source
Calls superclass method
# File lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/rows.rb, line 3
def initialize( request , station_infos , fares , normal_fare_groups , to_make_empty_row_when_no_station: false )
  super( request )
  @station_infos = station_infos
  @fares = fares
  @normal_fare_groups = normal_fare_groups
  @to_make_empty_row_when_no_station = to_make_empty_row_when_no_station
end

Public Instance Methods

render() click to toggle source
# File lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/rows.rb, line 11
def render
  if @station_infos.blank? and @to_make_empty_row_when_no_station
    render_empty_row_when_no_station
  elsif @station_infos.present?
    render_normal_rows
  end
end

Private Instance Methods

h_locals() click to toggle source
Calls superclass method
# File lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/rows.rb, line 32
def h_locals
  super.merge({
    # station_infos: @station_infos ,
    # fares: @fares ,
    normal_fare_groups: @normal_fare_groups ,
    station_infos_grouped_by_fare: station_infos_grouped_by_fare
  })
end
render_empty_row_when_no_station() click to toggle source
# File lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/rows.rb, line 21
  def render_empty_row_when_no_station
    h.render inline: <<-HAML , type: :haml
%tr{ class: :empty_row }<
  %td{ colspan:5 }<
    HAML
  end
render_normal_rows() click to toggle source
# File lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/rows.rb, line 28
def render_normal_rows
  ::TokyoMetro::App::Renderer::FareTable::ToEachRailwayLine::StationInfos.make_group_from( request , @station_infos , @fares , @normal_fare_groups ).render
end