Sha256: 4a631e6af1b1e4e0ca1082d8e51d0d6db2784247aff04e048f4fa40df7577faa

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

# API から取得したハッシュからインスタンスを生成するための Factory Pattern のクラス(メタクラス)
class TokyoMetro::Factory::Generate::Api::StationFacility::Info::BarrierFree::Info < TokyoMetro::Factory::Generate::Api::MetaClass::Info::NotOnTheTopLayer

  include ::TokyoMetro::ClassNameLibrary::Api::StationFacility
  include ::TokyoMetro::ClassNameLibrary::Api::StationFacility::BarrierFree::MetaClass

  include ::TokyoMetro::Factory::Generate::Api::MetaClass::Info::ConvertAndSetArrayData::ModuleForMethod

  def variables
    id = @hash[ "\@id" ]
    same_as = @hash[ "owl:sameAs" ]

    place_name = @hash[ "odpt:placeName" ]
    located_area_name = @hash[ "odpt:locatedAreaName" ]
    remark = @hash[ "ugsrv:remark" ]

    unless located_area_name.string? and /\A改札(?:内|外)\Z/ === located_area_name
      located_area_name = "☆☆☆☆☆☆☆☆"
    end

    [ id , same_as , service_details , place_name , located_area_name , remark ]
  end

  private

  def to_check_validity?
    true
  end

  def check_validity(h)
    super( h , barrier_free: true )
  end

  def variables__check
    puts variables__check__separation * 32
    puts "#{variables__check__letter} called: #{ self.class.name }\#variables"
    puts " " * 3 + "service detail class:"
    puts " " * 5 + "#{self.class.name}.barrier_free_service_detail_info_class"
    puts " " * 7 + "= #{ self.class.barrier_free_service_detail_info_class.name }"
    puts ""
  end

  def variables__check__separation
    "-"
  end

  def variables__check__letter
    "○"
  end

  def service_details
    covert_and_set_array_data(
      "odpt:serviceDetail" ,
      self.class.barrier_free_service_detail_list_class ,
      self.class.barrier_free_service_detail_info_class
    )
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/generate/api/station_facility/info/barrier_free/info.rb