Class: ArrowFormat::IntervalType

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#to_s

Constructor Details

#initialize(unit) ⇒ IntervalType

Returns a new instance of IntervalType.



509
510
511
512
# File 'lib/arrow-format/type.rb', line 509

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

Instance Attribute Details

#unitObject (readonly)

Returns the value of attribute unit.



508
509
510
# File 'lib/arrow-format/type.rb', line 508

def unit
  @unit
end

Class Method Details

.singletonObject



503
504
505
# File 'lib/arrow-format/type.rb', line 503

def singleton
  @singleton ||= new
end

Instance Method Details

#to_flatbuffersObject



514
515
516
517
518
# File 'lib/arrow-format/type.rb', line 514

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