Class: TokyoMetro::Api::TrainOperation::List

Inherits:
MetaClass::RealTime::List show all
Includes:
ClassNameLibrary::Api::TrainOperation
Defined in:
lib/tokyo_metro/api/train_operation/list.rb

Overview

各路線の列車運行情報を格納する配列

Instance Method Summary collapse

Methods inherited from MetaClass::RealTime::List

#valid?

Methods inherited from MetaClass::Fundamental::List

#find_by_same_as, #to_strf

Instance Method Details

#railway_linesObject Also known as: railway_lines_same_as



12
13
14
# File 'lib/tokyo_metro/api/train_operation/list.rb', line 12

def railway_lines
  self.map( &:railway_line )
end

#sort_by_railway_line_orderList

各路線の情報を路線の建設順に並べ替えるメソッド

Returns:



8
9
10
# File 'lib/tokyo_metro/api/train_operation/list.rb', line 8

def sort_by_railway_line_order
  self.class.new( self.sort_by { | line_info | ::TokyoMetro::Static.railway_lines[ line_info.railway_line ].order } )
end

#update!(http_client, time: ::TokyoMetro.time_now) ⇒ Object



18
19
20
# File 'lib/tokyo_metro/api/train_operation/list.rb', line 18

def update!( http_client , time: ::TokyoMetro.time_now )
  super( http_client , time: time )
end