Sha256: 160570280f8e0a1274f05fd4ba41fb16a6c84dc03d33f908af15db88caf22d4a

Contents?: true

Size: 418 Bytes

Versions: 6

Compression:

Stored size: 418 Bytes

Contents

module CureLine
  module TimeMethods
    # @param unixtime [Integer]
    #
    # @return [ActiveSupport::TimeWithZone] When `Time.zone` is initialized
    # @return [Time] When `Time.zone` is not initialized or without activesupport
    def time_at(unixtime)
      if Time.respond_to?(:zone) && Time.zone.respond_to?(:at)
        Time.zone.at(unixtime)
      else
        Time.at(unixtime)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cure_line-1.0.1 lib/cure_line/time_methods.rb
cure_line-1.0.0 lib/cure_line/time_methods.rb
cure_line-0.1.3 lib/cure_line/time_methods.rb
cure_line-0.1.2 lib/cure_line/time_methods.rb
cure_line-0.1.1 lib/cure_line/time_methods.rb
cure_line-0.1.0 lib/cure_line/time_methods.rb