module CureLine::TimeMethods

Public Instance Methods

time_at(unixtime) click to toggle source

@param unixtime [Integer]

@return [ActiveSupport::TimeWithZone] When `Time.zone` is initialized @return [Time] When `Time.zone` is not initialized or without activesupport

# File lib/cure_line/time_methods.rb, line 7
def time_at(unixtime)
  if Time.respond_to?(:zone) && Time.zone.respond_to?(:at)
    Time.zone.at(unixtime)
  else
    Time.at(unixtime)
  end
end