module Avro::LogicalTypes::IntDate

Constants

EPOCH_START

Public Class Methods

decode(int) click to toggle source
    # File lib/avro/logical_types.rb
210 def self.decode(int)
211   EPOCH_START + int
212 end
encode(date) click to toggle source
    # File lib/avro/logical_types.rb
204 def self.encode(date)
205   return date.to_i if date.is_a?(Numeric)
206 
207   (date - EPOCH_START).to_i
208 end