class TokyoMetro::Api::TrainLocation::List
各列車のロケーション情報を格納する配列
Public Instance Methods
before_decorate()
click to toggle source
# File lib/tokyo_metro/api/train_location/list.rb, line 25 def before_decorate ::TokyoMetro::Factory::BeforeDecorate::Api::TrainLocation::List.new( self ) end
decorate( request , railway_line )
click to toggle source
# File lib/tokyo_metro/api/train_location/list.rb, line 21 def decorate( request , railway_line ) ::TokyoMetro::Factory::Decorate::Api::TrainLocation::List.new( request , self , railway_line ) end
exclude_toei_mita_line()
click to toggle source
# File lib/tokyo_metro/api/train_location/list.rb, line 29 def exclude_toei_mita_line self.class.new( self.select { | train_location_info | train_location_info.railway_line != "odpt.Railway:Toei.Mita" } ) end
max_delay()
click to toggle source
# File lib/tokyo_metro/api/train_location/list.rb, line 10 def max_delay delays = self.map( &:delay ) if delays.all?( &:blank? ) nil elsif delays.all?( &:present? ) delays.max else raise "Error" end end
update!( http_client , railway_line , time: ::TokyoMetro.time_now )
click to toggle source
Calls superclass method
TokyoMetro::Api::MetaClass::RealTime::List#update!
# File lib/tokyo_metro/api/train_location/list.rb, line 6 def update!( http_client , railway_line , time: ::TokyoMetro.time_now ) super( http_client , railway_line , time: time ) end