class TokyoMetro::Factory::Generate::Api::TrainLocation::Info

API から取得したハッシュからインスタンスを生成するための Factory Pattern のクラス(メタクラス)

Public Instance Methods

variables() click to toggle source

Info クラスに送る変数のリスト @return [::Array]

# File lib/tokyo_metro/factory/generate/api/train_location/info.rb, line 8
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