Class: TokyoMetro::Api::TrainTimetable::Info::StationTime::List

Inherits:
MetaClass::Fundamental::List show all
Defined in:
lib/tokyo_metro/api/train_timetable/info/station_time/list.rb

Overview

個別の駅の発着時刻情報の配列

Instance Method Summary collapse

Methods inherited from MetaClass::Fundamental::List

#find_by_same_as, #to_strf

Instance Method Details

#station_time_info_and_index_of(station_same_as) ⇒ Object



34
35
36
37
38
39
# File 'lib/tokyo_metro/api/train_timetable/info/station_time/list.rb', line 34

def station_time_info_and_index_of( station_same_as )
  {
    station_time_in_train_timetable: station_time_info_of( station_same_as ) ,
    index_in_train_timetable: index_of( station_same_as ) ,
  }
end

#stationsObject



18
19
20
# File 'lib/tokyo_metro/api/train_timetable/info/station_time/list.rb', line 18

def stations
  stopping_stations.map( &:values ).flatten
end

#stopping_stationsObject

# @note StationTimetable::Info::TrainTime::List#seed と同じロジック

def seed( id_in_db , operation_day_id )
  raise "Error: #{self.class.name}\##{__method__}"
  self.each do | station_time |
    station_time.seed( id_in_db , operation_day_id )
  end
end


14
15
16
# File 'lib/tokyo_metro/api/train_timetable/info/station_time/list.rb', line 14

def stopping_stations
  self.map( &:station )
end