class Gorillib::Factory::EpochTimeFactory

Public Class Methods

typename() click to toggle source
# File lib/gorillib/model/type/extended.rb, line 41
def self.typename() :epoch_time ; end

Public Instance Methods

convert(obj) click to toggle source
# File lib/gorillib/model/type/extended.rb, line 44
def convert(obj)
  case obj
  when Numeric           then obj.to_f
  when Time              then obj.to_f
  when /\A\d{14}Z?\z/    then Time.parse(obj)
  when String            then Time.parse_safely(obj).to_f
  end
end