Class: EmtApi::Api
- Inherits:
-
Object
- Object
- EmtApi::Api
- Defined in:
- lib/emt_api/api.rb
Constant Summary collapse
- GET_LIST_LINES_URL =
'https://openbus.emtmadrid.es:9443/emt-proxy-server/last/bus/GetListLines.php'- EMT_CLIENT =
ENV['EMT_CLIENT']
- EMT_SECRET =
ENV['EMT_SECRET']
Class Method Summary collapse
Class Method Details
.get_list_lines(line_ids = nil, date = Time.now) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/emt_api/api.rb', line 10 def self.get_list_lines(line_ids = nil, date = Time.now) http_response = HTTP.post(GET_LIST_LINES_URL, form: { idClient: EMT_CLIENT, passKey: EMT_SECRET, SelectDate: date.strftime("%d/%m/%Y"), Lines: line_ids }) emt_response = EmtApi::Response.new(http_response) emt_response.valid_data? ? emt_response.data : nil end |