station master提供来自www.viaggiatreno.it公共站点的API接口
站长这个gem提供了一个来自公共站点的api接口。该项目利用该站点用于构建前端的api,以检索有关意大利铁路系统的实时信息,并为该信息提供更方便的界面。安装将此行添加到应用程序的Gemfile中:
gem 'station_master'
然后执行:
$ bundle install
或者自己安装:
$ gem install station_master
用法:
require 'station_master'
要根据城市名称查找特定车站:
StationMaster::Station.find_by_city('Torino')
它返回与参数字符串匹配的可能站列表。
要查找实时发车信息:
StationMaster::Schedule.find_station_departures('S06421')
它检索当前的车站出发状态。
要查找实...
下载地址
用户评论