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