Class: TokyoMetro::Api::PassengerSurvey::List

Inherits:
MetaClass::NotRealTime::List show all
Includes:
ClassNameLibrary::Api::PassengerSurvey, Modules::Common::ToFactory::Seed::List
Defined in:
lib/tokyo_metro/api/passenger_survey/list.rb

Overview

各駅の乗降者数の配列

Instance Method Summary collapse

Methods inherited from MetaClass::Fundamental::List

#find_by_same_as

Instance Method Details

#reverseList

Returns:



22
23
24
25
# File 'lib/tokyo_metro/api/passenger_survey/list.rb', line 22

def reverse
  ary = super
  self.class.new( ary )
end

#seedObject



36
37
38
# File 'lib/tokyo_metro/api/passenger_survey/list.rb', line 36

def seed
  super( ::Operator.all )
end

#select_year(*year_n) ⇒ List

調査年度を選択するメソッド

Parameters:

  • year_n (::Array <Integer (year)>)

    調査年度

Returns:



30
31
32
33
34
# File 'lib/tokyo_metro/api/passenger_survey/list.rb', line 30

def select_year( *year_n )
  self.class.new( self.select { | station |
    year_n.include?( station.survey_year )
  } )
end

#sort_by_passenger_journeysList

乗降客数でソートするメソッド

Returns:



16
17
18
# File 'lib/tokyo_metro/api/passenger_survey/list.rb', line 16

def sort_by_passenger_journeys
  self.class.new( self.sort_by( &:passenger_journeys ) )
end

#to_strf(indent = 0) ⇒ String

インスタンスの情報を整形した文字列にして返すメソッド

Parameters:

  • indent (Integer (>=0) (defaults to: 0)

    ] インデントの幅

Returns:

  • (String)


10
11
12
# File 'lib/tokyo_metro/api/passenger_survey/list.rb', line 10

def to_strf( indent = 0 )
  super( indent , 2 )
end