class Attrio::Types::Time

Public Class Methods

typecast(value, options = {}) click to toggle source
# File lib/attrio/types/time.rb, line 6
def self.typecast(value, options = {})
  begin
    options[:format].present? ? ::Time.strptime(value.to_s, options[:format]) : ::Time.parse(value.to_s)
  rescue ArgumentError => e
    nil
  end      
end
typecasted?(value, options = {}) click to toggle source
# File lib/attrio/types/time.rb, line 14
def self.typecasted?(value, options = {})
  value.is_a? ::Time
end