class TokyoMetro::Factory::Convert::Common::Api::StationFacility::BarrierFree::Facility::Escalator

Public Class Methods

new( object , generator_instance ) click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 5
def initialize( object , generator_instance )
  super( object )
  @generator_instance = generator_instance
end

Public Instance Methods

process() click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 10
def process
  if to_process?
    # puts self.class.name
    # puts same_as

    replace_infos
  end
end

Private Instance Methods

hash_in_generator_instance() click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 21
def hash_in_generator_instance
  @generator_instance.instance_variable_get( :@hash )
end
replace_infos() click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 29
def replace_infos
  raise "This method '#{ __method__ }' is not defined yet in this class '#{ self.class }'."
end
same_as() click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 25
def same_as
  hash_in_generator_instance[ "owl:sameAs" ]
end
service_details_after_prepending_patch_module( module_name , proc = nil ) click to toggle source
# File lib/tokyo_metro/factory/convert/common/api/station_facility/barrier_free/facility/escalator.rb, line 33
  def service_details_after_prepending_patch_module( module_name , proc = nil )
    service_detail_ary_new = hash_in_generator_instance[ "odpt:serviceDetail" ].map { | info_h |
      factory_instance = self.class.factory_for_generating_barrier_free_escalator_service_detail_from_hash.new( info_h )
      # puts "★ " + same_as
      if proc.nil? or ( proc.present? and proc.call( info_h ) )
        eval <<-PREPEND
          class << factory_instance
            prepend ::#{ module_name }
          end
        PREPEND
      end
      factory_instance.generate
    }

    return self.class.barrier_free_service_detail_list_class.new( service_detail_ary_new )
  end