Sha256: 5556f68514e7f59cf98af08bff28632af2c785971670473b568616b66f73e3f1

Contents?: true

Size: 260 Bytes

Versions: 9

Compression:

Stored size: 260 Bytes

Contents

module Timely
  module TimeSince
    def seconds_since
      ::DateTime.now.to_i - self.to_i
    end

    def minutes_since
      seconds_since/60
    end

    def hours_since
      minutes_since/60
    end
  end
end

DateTime.send :include, Timely::TimeSince

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
timely-0.5.0 lib/timely/time_since.rb
timely-0.4.2 lib/timely/time_since.rb
timely-0.4.1 lib/timely/time_since.rb
timely-0.4.0 lib/timely/time_since.rb
timely-0.3.4 lib/timely/time_since.rb
timely-0.3.2 lib/timely/time_since.rb
timely-0.3.1 lib/timely/time_since.rb
timely-0.3.0 lib/timely/time_since.rb
timely-0.1.0 lib/timely/time_since.rb