Class: TokyoMetro::Api::Station::Info::ConnectingRailwayLine::List

Inherits:
TokyoMetro::Api::Station::Info::Common::List show all
Defined in:
lib/tokyo_metro/api/station/info/connecting_railway_line/list.rb

Overview

乗り換え可能路線の一覧を扱うクラス

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TokyoMetro::Api::Station::Info::Common::List

#seed, #to_strf

Methods included from Modules::Common::ToFactory::Seed::Group

#seed

Methods inherited from MetaClass::Fundamental::List

#find_by_same_as, #to_strf

Class Method Details

.factory_for_seeding_this_classObject



4
5
6
# File 'lib/tokyo_metro/api/station/info/connecting_railway_line/list.rb', line 4

def self.factory_for_seeding_this_class
  factory_for_seeding_connecting_railway_lines_of_each_station
end

Instance Method Details

#railway_linesObject



19
20
21
# File 'lib/tokyo_metro/api/station/info/connecting_railway_line/list.rb', line 19

def railway_lines
  self.map( &:railway_line )
end

#set_index_in_station!Object



8
9
10
11
12
13
# File 'lib/tokyo_metro/api/station/info/connecting_railway_line/list.rb', line 8

def set_index_in_station!
  self.each.with_index(1) do | connecting_railway_line , i |
    connecting_railway_line.send( :set_index_in_station , i )
  end
  return self
end

#sort!Object



15
16
17
# File 'lib/tokyo_metro/api/station/info/connecting_railway_line/list.rb', line 15

def sort!
  self.sort_by!( &:index_in_station )
end