Permalink
Browse files

wrap around annoying getters

  • Loading branch information...
1 parent 4f18878 commit d76ae7091dd1a8d11e2ca60d81e708ee73dc02cf @substack committed Nov 7, 2011
Showing with 13 additions and 1 deletion.
  1. +13 −1 server.rb
View
@@ -8,7 +8,19 @@
station = Bart::Station.new(name)
station.load_departures
if cb.respond_to? :call then
- cb.call(station.departures)
+ cb.call(station.departures.map { |dep|
+ {
+ :destination => dep.destination.name,
+ :estimates => dep.estimates.map { |est|
+ {
+ :minutes => est.minutes,
+ :platform => est.platform,
+ :direction => est.direction,
+ :length => est.length,
+ }
+ }
+ }
+ })
end
end,
}).listen(5050)

0 comments on commit d76ae70

Please sign in to comment.