README.md in ierail-0.3.4 vs README.md in ierail-0.3.5
- old
+ new
@@ -1,7 +1,8 @@
[![Build Status](https://travis-ci.org/oisin/ierail.png?branch=master)](https://travis-ci.org/oisin/ierail)
[![Coverage Status](https://coveralls.io/repos/oisin/ierail/badge.png?branch=master)](https://coveralls.io/r/oisin/ierail)
+[![Gem Version](https://badge.fury.io/rb/ierail.png)](http://badge.fury.io/rb/ierail)
## Irish Rail API Ruby Wrapper
I wrote most of this on the train, as is appropriate.
@@ -10,59 +11,72 @@
## Usage
### Grab the IERail gem
-`$ gem install ierail`
+```bash
+$ gem install ierail
+```
-<pre><code>require 'ierail'
+```ruby
+require 'ierail'
ir = IERail.new
-</code></pre>
+```
### Find all Southbound trains serving Clongriffin station
-<pre><code>trains = ir.southbound_from('clongriffin')</code></pre>
+```ruby
+trains = ir.southbound_from('clongriffin')
+```
### Find all trains serving Clongriffin in the next 30 minutes
-<pre><code>trains = ir.station_times('clongriffin', 30)
+```ruby
+trains = ir.station_times('clongriffin', 30)
-trains.each { |t| puts t.inspect }
-</code></pre>
+trains.each { |t| p t.inspect }
+```
### Find all Northbound trains serving Clongriffin before / after a certain time
-<pre><code>trains = ir.northbound_from('clongriffin').after('HH:MM')
+```ruby
+trains = ir.northbound_from('clongriffin').after('HH:MM')
trains = ir.northbound_from('clongriffin').before('HH:MM')
-</code></pre>
+```
NB: "HH:MM" must be soon, as the API, by default, returns upcoming
arrivals
### Find all Southbound trains from Malahide in the next N minutes
-<pre><code>trains = ir.southbound_from('malahide').in(N)
-</code></pre>
+```ruby
+trains = ir.southbound_from('malahide').in(N)
+```
### Find out information for a specific train
-<pre><code>trains = ir.station('clongriffin', 60)
+```ruby
+trains = ir.station('clongriffin', 60)
trains.first.last_location # "Arrived Harmonstown"
-trains.first.origin # {:name=>"Greystones", :time=>"07:30"}
+trains.first.origin # {:name=>"Greystones", :time=>2013-05-13 22:10:00 +0100}
-trains.first.destination # {:name=>"Malahide", :time=>"08:49"}
+trains.first.destination # {:name=>"Malahide", :time=>2013-05-13 22:10:00 +0100}
-trains.first.arrival # {:scheduled=>"08:40", :expected=>"08:41"}
+trains.first.arrival # {:scheduled=>2013-05-13 22:09:00 +0100, :expected=>2013-05-13 22:10:00 +0100}
-trains.first.departure # {:scheduled=>"08:41", :expected=>"08:41"}
+trains.first.departure # {:scheduled=>2013-05-13 22:09:00 +0100, :expected=>2013-05-13 22:10:00 +0100}
trains.first.duein # "2"
trains.first.late? # 0 || 1
-</code></pre>
+```
-Check the **main.rb** for additional usage.
+Check the [main.rb](main.rb) for additional usage.
-Pull requests welcome, because there's damn all in it at the moment. Please accompany the pull request with an appropriate test.
+Pull requests welcome, because there's damn all in it at the moment. Please accompany the pull request with an appropriate test, and if you can, an example here in the README.
+
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/oisin/ierail/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+