Class: ArrowFormat::NullArray

Inherits:
Array
  • Object
show all
Defined in:
lib/arrow-format/array.rb

Instance Attribute Summary

Attributes inherited from Array

#offset, #size, #type, #validity_buffer

Instance Method Summary collapse

Methods inherited from Array

#empty?, #null?, #slice, #valid?

Constructor Details

#initialize(size) ⇒ NullArray

Returns a new instance of NullArray.



143
144
145
# File 'lib/arrow-format/array.rb', line 143

def initialize(size)
  super(NullType.singleton, size, nil)
end

Instance Method Details

#each_bufferObject



147
148
149
# File 'lib/arrow-format/array.rb', line 147

def each_buffer
  return to_enum(__method__) unless block_given?
end

#n_nullsObject



151
152
153
# File 'lib/arrow-format/array.rb', line 151

def n_nulls
  @size
end

#to_aObject



155
156
157
# File 'lib/arrow-format/array.rb', line 155

def to_a
  [nil] * @size
end