Sha256: 58c60b99c60a8ba950562341aa1546b8e31a35b75b2439b6bfa3f23f7b1d5c6d

Contents?: true

Size: 1002 Bytes

Versions: 1

Compression:

Stored size: 1002 Bytes

Contents

module TokyoMetro::Refinement::Api::TrainTimetable::Info::Match

  def matches_station_timetable?( train , station_timetable_info , operation_day_in_db )
    matches_station_timetable_as_to_departure_time?( train , station_timetable_info ) and matches_station_timetable_as_to_fundamental_infos?( train , station_timetable_info , operation_day_in_db )
  end

  private

  def matches_station_timetable_as_to_departure_time?( train , station_timetable_info )
    _time_of_this_station = time_of( station_timetable_info.stations_same_as.uniq )
    _time_of_this_station.present? and _time_of_this_station[ :departure ] == train.departure_time_array
  end

  def matches_station_timetable_as_to_fundamental_infos?( train , station_timetable_info , operation_day_in_db )
    actually_terminating?( train.terminal_stations_same_as( station_timetable_info.railway_lines ) ) and operated_on?( operation_day_in_db.name_en ) and on_the_railway_line_of?( station_timetable_info.railway_lines_same_as )
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/refinement/api/train_timetable/info/match.rb