Sha256: c09a955c1bd82e7ee8a2786f3ff6ab9a883f29b9a183292db81cbd72482b1a47

Contents?: true

Size: 698 Bytes

Versions: 1

Compression:

Stored size: 698 Bytes

Contents

class TokyoMetro::Api::StationTimetable::Info::TrainTime::Info::Note::ConnectionInfo

  def initialize( station , connection )
    @station = station
    @connection = connection
  end
  attr_reader :station , :connection

  def seed_and_get_id( railway_line_ids )
    station_info_in_db = ::Station::Info.find_by( name_ja: @station , railway_line_id: railway_line_ids )
    connection_info_h = {
      station_info_id: station_info_in_db.id ,
      connection: @connection ,
      note: self.to_s
    }
    ::StationTimetableConnectionInfo.find_or_create_by( connection_info_h ).id
    # ::TrainTimetableConnectionInfo.find_or_create_by( connection_info_h ).id
  end

  def to_s
    ""
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/api/station_timetable/info/train_time/info/note/connection_info.rb