Sha256: d86e3a776da840d78642f04df248a65c1ba1d6039c6fd36d0ca907b841f981db

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

# 列車の終着駅の名称 (same_as) をカスタマイズするためのクラス
# @note API からの情報のカスタマイズ
class TokyoMetro::Factory::Convert::Common::Api::MetaClass::TrainInfos::MetaClass::StationName::Info < TokyoMetro::Factory::Convert::Common::Api::MetaClass::Fundamental::Normal

  def initialize( object , station_attr )
    super( object )
    @station_attr = station_attr
  end

  def process
    if to_process?
      convert_station_name
    end
  end

  private

  def to_process?
    raise "This method '#{ __method__ }' is not defined in this class '#{ self.class }'."
  end

  def convert_station_name
    @object.instance_variable_set(
      @station_attr ,
      station_name_new
    )
  end

  def station_name_new
    raise "This method '#{ __method__ }' is not defined in this class '#{ self.class }'."
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/convert/common/api/meta_class/train_infos/meta_class/station_name/info.rb