0.0
No commit activity in last 3 years
No release in over 3 years
A simple api caller for deutsche bahn api.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

 Project Readme

Deutschebahn

This is a simple gem to fetch station data of the Deutsche Bahn. The gem uses the json api from http://54.93.120.139/api/station/

Installation

Add this line to your application's Gemfile:

gem 'deutschebahn'

And then execute:

$ bundle

Or install it yourself as:

$ gem install deutschebahn

Usage

require 'deutschebahn'

stations = Deutschebahn.stations
stations.first.name

The Deutschebahn.stations creates an array of Deutschebahn::Station

###Method calls The Deutschebahn::Station provides basic method calls.

  • local_distance_traffic?
  • long_distance_traffic?
  • name
  • state
  • management
  • place
  • street
  • transport_association
  • stops
  • supporter
  • zipcode
  • number
  • category

Development

The gem is developed for the 3rd hackerthon from the Deutsch Bahn.

###Data Fetching The Data from the json looks like this.

{
    "_id": "566af53f271da51420e9c385",
    "bfNr": 119,
    "bundesland": "Hessen",
    "bm": "Darmstadt",
    "station": "Altheim (Hess)",
    "bfDsAbk": "FAT",
    "katVst": 6,
    "strasse": "Münstererstr. 19",
    "plz": 64839,
    "ort": "Münster",
    "aufgabentraeger": "Rhein-Main-Verkehrsverbund GmbH",
    "verkehrsVerb": "RMV",
    "fernverkehr": true,
    "nahverkehr": true,
    "__v": 0
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DenniJensen/deutschebahn.