Class: ArrowFormat::Org::Apache::Arrow::Flatbuf::Int

Inherits:
FlatBuffers::Table
  • Object
show all
Defined in:
lib/arrow-format/org/apache/arrow/flatbuf/int.rb

Constant Summary collapse

FIELDS =
{
  bit_width: ::FlatBuffers::Field.new(:bit_width, 0, 4, :int, 0),
  signed?: ::FlatBuffers::Field.new(:signed?, 1, 6, :bool, 0),
}
Data =
define_data_class

Instance Method Summary collapse

Instance Method Details

#bit_widthObject



22
23
24
25
26
27
# File 'lib/arrow-format/org/apache/arrow/flatbuf/int.rb', line 22

def bit_width
  field_offset = @view.unpack_virtual_offset(4)
  return 0 if field_offset.zero?

  @view.unpack_int(field_offset)
end

#signed?Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
# File 'lib/arrow-format/org/apache/arrow/flatbuf/int.rb', line 29

def signed?
  field_offset = @view.unpack_virtual_offset(6)
  return false if field_offset.zero?

  @view.unpack_bool(field_offset)
end