Sha256: 8594ff7d8134c578ab5ef55b4da3a73de8ab1d2c35790c6c8a7054d55f521de4
Contents?: true
Size: 852 Bytes
Versions: 1
Compression:
Stored size: 852 Bytes
Contents
# 始発駅の情報を扱うクラス(メタクラス) class TokyoMetro::Api::StationTimetable::Info::TrainTime::Info::Note::StartingStation::Fundamental # Constructor def initialize( str ) @station = str end # @return [String] 始発駅 attr_reader :station alias :sta :station # インスタンスの情報を文字列に変換して返すメソッド # @return [String] def to_s "始発駅:#{@station}" end 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 ) starting_station_info_h = { station_info_id: station_info_in_db.id } info_id = ::StationTimetableStartingStationInfo.find_or_create_by( starting_station_info_h ).id puts "★ #{self.station}駅始発" puts "" return info_id 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/starting_station/fundamental.rb |