Sha256: 8753a6b470aa026ffacdbefcb8ae2e4ca5a545853f941924673e14a0b178486f

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

class TokyoMetro::Factory::Convert::Customize::Api::StationFacility::PlatformTransferInfoAtNakanoSakaue::Info < TokyoMetro::Factory::Convert::Common::Api::MetaClass::Fundamental::Normal

  def process
    if to_convert?
      convert_railway_line_name_of_platform_infos_to_marunouchi_branch_line
    end

  end

  private

  def convert_railway_line_name_of_platform_infos_to_marunouchi_branch_line
    railway_lines = {
      main: ::TokyoMetro::Modules::Common::Dictionary::RailwayLine::StringInfo.marunouchi_same_as ,
      branch: ::TokyoMetro::Modules::Common::Dictionary::RailwayLine::StringInfo.marunouchi_branch_same_as
    }
    for_honancho = "odpt.RailDirection:TokyoMetro.Honancho"

    @object.platform_infos.each do | platform_info |
      if platform_info.railway_line == railway_lines[ :main ] and platform_info.car_composition == 6
        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: { from: railway_lines[ :main ] , to: railway_lines[ :branch ] } ,
              railway_direction: for_honancho
            )
          end

        end
      end
    end

  end

  def to_convert?
    @object.same_as == "odpt.StationFacility:TokyoMetro.NakanoSakaue"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/convert/customize/api/station_facility/platform_transfer_info_at_nakano_sakaue/info.rb