Sha256: 8c71e3d668c072ceb7d686a9344fa22e1dd2e195acc2289859dcfa6bc78a20b8

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

# API から取得したハッシュからインスタンスを生成するための Factory Pattern のクラス(メタクラス)
class TokyoMetro::Factory::Generate::Api::TrainLocation::Info < TokyoMetro::Factory::Generate::Api::MetaClass::Info::Fundamental

  include ::TokyoMetro::ClassNameLibrary::Api::TrainLocation

  # Info クラスに送る変数のリスト
  # @return [::Array]
  def variables
    id = @hash[ "\@id" ]
    same_as = @hash[ "owl:sameAs" ]

    dc_date = DateTime.parse( @hash[ "dc:date" ] )
    valid = DateTime.parse( @hash[ "dct:valid" ] )
    frequency = @hash[ "odpt:frequency" ]

    train_number = @hash[ "odpt:trainNumber" ]
    train_type = @hash[ "odpt:trainType" ]

    railway_direction = @hash[ "odpt:railDirection" ]
    railway_line = @hash[ "odpt:railway" ]
    train_owner = @hash[ "odpt:trainOwner" ]

    starting_station = @hash[ "odpt:startingStation" ]
    terminal_station = @hash[ "odpt:terminalStation" ]

    delay = @hash[ "odpt:delay" ]

    from_station = @hash[ "odpt:fromStation" ]
    to_station = @hash[ "odpt:toStation" ]

    [ id , same_as , train_number , train_type , dc_date , valid , frequency ,
      railway_line , train_owner , railway_direction , delay , starting_station , terminal_station , from_station , to_station ]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/generate/api/train_location/info.rb