Class: ArrowFormat::DateType

Inherits:
TemporalType show all
Defined in:
lib/arrow-format/type.rb

Direct Known Subclasses

Date32Type, Date64Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#to_s

Constructor Details

#initialize(unit) ⇒ DateType

Returns a new instance of DateType.



349
350
351
352
# File 'lib/arrow-format/type.rb', line 349

def initialize(unit)
  super()
  @unit = unit
end

Instance Attribute Details

#unitObject (readonly)

Returns the value of attribute unit.



348
349
350
# File 'lib/arrow-format/type.rb', line 348

def unit
  @unit
end

Instance Method Details

#to_flatbuffersObject



354
355
356
357
358
# File 'lib/arrow-format/type.rb', line 354

def to_flatbuffers
  fb_type = FB::Date::Data.new
  fb_type.unit = FB::DateUnit.try_convert(@unit.to_s.upcase)
  fb_type
end