Class: TokyoMetro::Factory::Get::Api::DataSearch::Station
- Inherits:
-
MetaClass::Search::DataSearch
- Object
- MetaClass::Fundamental
- MetaClass::Search
- MetaClass::Search::DataSearch
- TokyoMetro::Factory::Get::Api::DataSearch::Station
- Includes:
- ClassNameLibrary::Api::Station
- Defined in:
- lib/tokyo_metro/factory/get/api/data_search/station.rb
Overview
API から駅情報 odpt:Station のデータを取得するための Factory Pattern のクラス
Class Method Summary collapse
-
.process(http_client, id, same_as, title, operator, railway_line, station_code, parse_json, generate_instance, to_inspect) ⇒ Object
API からデータを取得するメソッド.
Instance Method Summary collapse
-
#initialize(id, same_as, title, operator, railway_line, station_code, parse_json, generate_instance, to_inspect) ⇒ Station
constructor
Constructor.
-
#parameters ⇒ Hash
HTTPClient に送るパラメーター.
Methods inherited from MetaClass::Fundamental
Constructor Details
#initialize(id, same_as, title, operator, railway_line, station_code, parse_json, generate_instance, to_inspect) ⇒ Station
Constructor
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/tokyo_metro/factory/get/api/data_search/station.rb', line 7 def initialize( id , same_as , title , operator , railway_line , station_code , parse_json , generate_instance , to_inspect ) super( parse_json , generate_instance , to_inspect ) @id = id @same_as = same_as @title = title @operator = operator @railway_line = railway_line @station_code = station_code end |
Class Method Details
.process(http_client, id, same_as, title, operator, railway_line, station_code, parse_json, generate_instance, to_inspect) ⇒ Object
API からデータを取得するメソッド
39 40 41 42 43 44 45 46 |
# File 'lib/tokyo_metro/factory/get/api/data_search/station.rb', line 39 def self.process( http_client , id , same_as , title , operator , railway_line , station_code , parse_json , generate_instance , to_inspect ) info = self.new( id , same_as , title , operator , railway_line , station_code , parse_json , generate_instance , to_inspect ) info.get_data( http_client ) end |
Instance Method Details
#parameters ⇒ Hash
HTTPClient に送るパラメーター
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tokyo_metro/factory/get/api/data_search/station.rb', line 21 def parameters h = super set_parameter_send_to_api( h , "\@id" , @id , String ) set_parameter_send_to_api( h , "owl:sameAs" , @same_as , String ) set_parameter_send_to_api( h , "dc:title" , @title , String ) set_parameter_send_to_api( h , "odpt:operator" , @operator , String ) set_parameter_send_to_api( h , "odpt:railway" , @railway_line , String ) set_parameter_send_to_api( h , "odpt:station_code" , @station_code , String ) h end |