Skip to content

Commit

Permalink
Update docs for version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Douglas Smith committed Mar 10, 2012
1 parent 5a80421 commit 1c8567f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions README.md
@@ -1,14 +1,14 @@
# hrt_bus

Ruby gem for public HRT bus location data
Ruby gem for real-time Hampton Roads Transit bus location data

## Installation

gem install hrt_bus

## Examples

### HRT bus as a Ruby ActiveModel object
### A Bus as a Ruby ActiveModel object

HrtBus::Rider.new(:route_id => "20", :direction => "inbound").bus

Expand All @@ -21,6 +21,27 @@ Ruby gem for public HRT bus location data
attr_accessor :time = Sat, 03 Mar 2012 23:24:28 +0000,
>

### Is my bus late?

HrtBus::Rider.new(:route_id => "20", :direction => "inbound").bus.late?

### Send yourself a SMS or Tweet when your bus is close!

(1..15).each do |i|

rider = HrtBus::Rider.new(:route_id => "2",
:direction => "inbound",
:lat => "36.870347",
:lon => "-76.301163" )

if rider.bus.present? && rider.distance_to_bus <= 3
# Do something really cool like send a SMS or Tweet!
end

sleep 30

end

### Generate a static Google Map for a bus

HrtBus::Rider.new(:route_id => "15", :direction => "outbound").bus.static_map
Expand Down Expand Up @@ -55,27 +76,6 @@ Ruby gem for public HRT bus location data
]
...

### Determine if a bus is valid

HrtBus::Bus.active_buses.select { |bus| bus.route_id => "2" }.first.valid?

### Send yourself a SMS or Tweet when your bus is close!

(1..15).each do |i|

rider = HrtBus::Rider.new(:route_id => "2",
:direction => "inbound",
:lat => "36.870347",
:lon => "-76.301163" )

if rider.bus.present? && rider.distance_to_bus <= 3
# Do something really cool like send a SMS or Tweet!
end

sleep 30

end

## Contributing to hrt_bus

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
Expand Down
4 changes: 2 additions & 2 deletions hrt_bus.gemspec
Expand Up @@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.authors = ["Brian Douglas Smith"]
s.email = ["m.b1205@gmail.com"]
s.homepage = "https://github.com/bds/hrt_bus"
s.summary = %q{Ruby gem for real-time public HRT bus location data}
s.description = %q{Ruby gem for real-time public HRT bus location data}
s.summary = %q{Real-time Hampton Roads Transit bus location data}
s.description = %q{Bus number, route, GPS coordiantes, early/ontime/late and more}

s.rubyforge_project = "hrt_bus"

Expand Down

0 comments on commit 1c8567f

Please sign in to comment.