Class: ArrowFormat::FloatingPointType

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

Direct Known Subclasses

Float32Type, Float64Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#to_s

Constructor Details

#initialize(precision) ⇒ FloatingPointType

Returns a new instance of FloatingPointType.



284
285
286
287
# File 'lib/arrow-format/type.rb', line 284

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

Instance Attribute Details

#precisionObject (readonly)

Returns the value of attribute precision.



283
284
285
# File 'lib/arrow-format/type.rb', line 283

def precision
  @precision
end

Instance Method Details

#to_flatbuffersObject



289
290
291
292
293
# File 'lib/arrow-format/type.rb', line 289

def to_flatbuffers
  fb_type = FB::FloatingPoint::Data.new
  fb_type.precision = FB::Precision.try_convert(@precision.to_s.upcase)
  fb_type
end