Sha256: f9f94a29b7815ababd0d61f4b65e2818c8a2abd9cd02019878309ec4dd415941

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

module Aggro
  module Transform
    # Private: Transforms time representations.
    module Time
      module_function

      def deserialize(value)
        if value.is_a? ::String
          ::Time.parse(value)
        elsif value.is_a? ::Integer
          ::Time.parse(value.to_s)
        elsif value.is_a? ::Time
          value
        end
      end

      def serialize(value)
        value.to_s if value.is_a? ::Time
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aggro-0.0.4 lib/aggro/transform/time.rb