Sha256: 38ce1bef13389ada72ad3332b95a81a64162e0ece3e21cb856be4f266a9387a3

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# 各路線の情報の配列
class TokyoMetro::Api::RailwayLine::List < TokyoMetro::Api::MetaClass::Hybrid::List

  include ::TokyoMetro::ClassNameLibrary::Api::RailwayLine
  include ::TokyoMetro::Modules::Common::ToFactory::Seed::List

  # インスタンスの情報を整形した文字列にして返すメソッド
  # @param indent [Integer (>=0)] インデントの幅
  # @return [String]
  def to_strf( indent = 0 )
    super( indent , 3 )
  end

  def sort_by_railway_line_order
    self.class.new( self.sort_by { | railway_line | ::TokyoMetro::Static.railway_lines[ railway_line.same_as ].order } )
  end

  [ :station_order_infos , :travel_time_infos , :women_only_car_infos ].each do | method_base_name |
    eval <<-DEF

      def seed_#{ method_base_name }
        __seed__(
          factory_name: "factory_for_seeding_list_of_#{ method_base_name }" ,
          method_name: __method__ ,
          not_on_the_top_layer: false ,
          display_number: true
        )
      end

    DEF
  end

  # @note 使用停止中
  undef :seed_station_order_infos

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/api/railway_line/list.rb