class TokyoMetro::Api::RailwayLine::Info::StationOrder::Info

各駅の情報を扱うクラス

Attributes

index[R]

駅の順序 <odpt:index - xsd:integer> @return [Integer] @note 駅番号ではない。

name[R]

駅名 <odpt:station - odpt:Station> @return [String]

station[R]

駅名 <odpt:station - odpt:Station> @return [String]

station_name[R]

駅名 <odpt:station - odpt:Station> @return [String]

Public Class Methods

factory_for_generating_from_hash() click to toggle source
# File lib/tokyo_metro/api/railway_line/info/station_order/info.rb, line 39
def self.factory_for_generating_from_hash
  factory_for_generating_station_order_info_from_hash
end
new( index , station ) click to toggle source

Constructor

# File lib/tokyo_metro/api/railway_line/info/station_order/info.rb, line 5
def initialize( index , station )
  @index = index
  @station = station
end

Public Instance Methods

seed() click to toggle source

@note 使用停止中 - {TokyoMetro::Static::Station::InEachRailwayLine::Info#seed}を参照

# File lib/tokyo_metro/api/railway_line/info/station_order/info.rb, line 33
def seed
  ::Station::Info.find_by( same_as: @station ).update( index_in_railway_line: @index )
end
to_h() click to toggle source
# File lib/tokyo_metro/api/railway_line/info/station_order/info.rb, line 28
def to_h
  { "odpt:index" => @index , "odpt:station" => @station }
end
to_s( indent = 0 ) click to toggle source

インスタンスの情報を文字列にして返すメソッド @param indent [Integer (>=0)] インデントの幅 @return [String]

# File lib/tokyo_metro/api/railway_line/info/station_order/info.rb, line 24
def to_s( indent = 0 )
  " " * indent + "\[#{ self.index.to_s.rjust(4) }\] #{self.station}"
end
Also aliased as: to_strf
to_strf( indent = 0 )
Alias for: to_s