Class: TokyoMetro::Factory::Generate::Api::MlitRailwayLine::Info

Inherits:
TokyoMetro::Factory::Generate::Api::MetaClass::Info::Fundamental show all
Includes:
ClassNameLibrary::Api::MlitRailwayLine
Defined in:
lib/tokyo_metro/factory/generate/api/mlit_railway_line/info.rb

Overview

API から取得したハッシュからインスタンスを生成するための Factory Pattern のクラス(メタクラス)

Instance Method Summary collapse

Methods inherited from TokyoMetro::Factory::Generate::Api::MetaClass::Info::Fundamental

#generate, #initialize, instance_class, process, #to_check_validity?

Constructor Details

This class inherits a constructor from TokyoMetro::Factory::Generate::Api::MetaClass::Info::Fundamental

Instance Method Details

#variables::Array

Info クラスに送る変数のリスト

Returns:

  • (::Array)


8
9
10
11
12
13
14
15
16
# File 'lib/tokyo_metro/factory/generate/api/mlit_railway_line/info.rb', line 8

def variables
  id = @hash[ "\@id" ]

  geo_long = @hash[ "geo:long" ]
  geo_lat = @hash[ "geo:lat" ]
  region = @hash[ "ug:region" ]

  [ id , geo_long , geo_lat , region , variables_of_mlit_datas ].flatten
end