Sha256: 8a385914cee44eb70dae0c94d9c72be68bf740f746a2ba58b24ca1c557f99c72

Contents?: true

Size: 671 Bytes

Versions: 1

Compression:

Stored size: 671 Bytes

Contents

#「データ検索 API を利用するリアルタイム情報」の配列(メタクラス)
class TokyoMetro::Api::MetaClass::RealTime::List < TokyoMetro::Api::MetaClass::Fundamental::List

  include ::TokyoMetro::Modules::Api::Common::RealTime

  def valid?( time = ::TokyoMetro.time_now )
    self.all? { | info | info.valid?( time ) }
  end

  def update!( *args , time: ::TokyoMetro.time_now )
    unless valid?( time )
      self.delete!( &:present? )
      new_infos = self.class.toplevel_namespace.get( *args , parse_json: true , generate_instance: true )
      new_infos.each do | info |
        self.push( info )
      end
    end
    return self
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/api/meta_class/real_time/list.rb