Sha256: 8a27d1431c347abf8b36b2f7544b6afa0e2ccb9106996b4704b57db7f472c4cb

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

require 'action_view'

module Muni
  class Prediction < Base
    include ActionView::Helpers::DateHelper
    def time
      Time.at((epochTime.to_i / 1000.0).to_i)
    end
    
    def pretty_time
      if time > Time.now
        distance_of_time_in_words_to_now(time)
      elsif time < Time.now
        time_ago_in_words(time)
      else
        "Arriving"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
muni-0.0.2 lib/muni/prediction.rb
muni-0.0.1 lib/muni/prediction.rb