Sha256: 191a1285f8fc963900aa9710346c0f2471b37e04ed5429806fb7c8e3c908578c

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

class TokyoMetro::Factory::Convert::Patch::Api::StationFacility::PlatformTransferInfoAtKudanshita::Info < TokyoMetro::Factory::Convert::Common::Api::MetaClass::Fundamental::Normal

  SAME_AS = "odpt.StationFacility:TokyoMetro.Kudanshita"
  RAILWAY_LINE = "odpt.Railway:Toei.Shinjuku"

  INVALID_DIRECTION = RAILWAY_LINE
  VALID_DIRECTION = "odpt.RailDirection:Toei.Shinjuku"

  def process
    if to_process?
      convert_platform_transfer_infos_at_kudanshita
    end
  end

  private

  def to_process?
    @object.same_as == SAME_AS
  end

  def convert_platform_transfer_infos_at_kudanshita
    @object.platform_infos.each do | platform_info |
      if platform_info.transfer_infos.present?

        platform_info.transfer_infos.each do | transfer_info |
          ::TokyoMetro::Factory::Convert::Common::Api::StationFacility::Platform::Transfer.process(
            transfer_info ,
            railway_line: RAILWAY_LINE ,
            railway_direction: { from: INVALID_DIRECTION , to: VALID_DIRECTION }
          )
        end

      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/convert/patch/api/station_facility/platform_transfer_info_at_kudanshita/info.rb