Sha256: 4d5c9a363a940e0c8ca97e3e81d2659864f18b1fe0bbbe9fda71b74bd0214d7f

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

module Nextbus
  class Prediction

    include InstantiateWithAttrs
    include AttrWithDefault

    attr_accessor :time, :departure, :stop

    def epoch_time=(nanosecs)
      self.time = Time.at(nanosecs.to_i/1000)
    end

    def self.all(agency_id, route_id, stop_id)
      Nextbus.client.predictions(agency_id, route_id, stop_id).map{|prediction| new(prediction) }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nextbus-0.0.1 lib/nextbus/prediction.rb
nextbus-0.0.0 lib/nextbus/prediction.rb