Class: TokyoMetro::App::Renderer::FareTable::ToEachRailwayLine::StationInfos::GroupInfo

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/station_infos/group_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, normal_fare_group_id, station_info, normal_fare_groups) ⇒ GroupInfo

Returns a new instance of GroupInfo.



3
4
5
6
7
8
# File 'lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/station_infos/group_info.rb', line 3

def initialize( request , normal_fare_group_id , station_info , normal_fare_groups )
  super( request )

  @normal_fare_group = set_normal_fare_group( normal_fare_group_id , normal_fare_groups )
  @station_infos = [ station_info ]
end

Instance Method Details

#add(station_info) ⇒ Object



10
11
12
# File 'lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/station_infos/group_info.rb', line 10

def add( station_info )
  @station_infos << station_info
end

#renderObject



14
15
16
17
18
19
20
# File 'lib/tokyo_metro/app/renderer/fare_table/to_each_railway_line/station_infos/group_info.rb', line 14

def render
  if @normal_fare_group.present?
    render_when_normal_fare_group_is_present
  else
    render_when_normal_fare_group_is_not_present
  end
end