Sha256: e288eb42a29a97dab709c4c53d4101e6ec7279011d60e3d756d74f657f88fe85

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

class TokyoMetro::Factory::BeforeSeed::Api::MetaClass::Timetables::TrainType::Pattern

  def initialize( pattern_id , train_type , railway_line_id , terminal_station_info_id , operation_day_id )
    @pattern_id = pattern_id
    @train_type = train_type
    @railway_line_id = railway_line_id
    @terminal_station_info_id = terminal_station_info_id
    @operation_day_id = operation_day_id
  end

  attr_reader :pattern_id

  def match?( train_type , railway_line_id , terminal_station_info_id , operation_day_id )
    train_type_is?( train_type ) and railway_line_is?( railway_line_id ) and terminal_station_is?( terminal_station_info_id ) and operation_day_is?( operation_day_id )
  end

  private

  def train_type_is?( train_type )
    @train_type == train_type
  end

  def railway_line_is?( railway_line_id )
    @railway_line_id == railway_line_id
  end

  def terminal_station_is?( terminal_station_info_id )
    @terminal_station_info_id == terminal_station_info_id
  end

  def operation_day_is?( operation_day_id )
    @operation_day_id == operation_day_id
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/before_seed/api/meta_class/timetables/train_type/pattern.rb