Module: Avro::LogicalTypes::IntDate
- Defined in:
- lib/avro-patches/logical_types/logical_types.rb
Constant Summary collapse
- EPOCH_START =
Date.new(1970, 1, 1)
Class Method Summary collapse
Class Method Details
.decode(int) ⇒ Object
12 13 14 |
# File 'lib/avro-patches/logical_types/logical_types.rb', line 12 def self.decode(int) EPOCH_START + int end |
.encode(date) ⇒ Object
8 9 10 |
# File 'lib/avro-patches/logical_types/logical_types.rb', line 8 def self.encode(date) (date - EPOCH_START).to_i end |