Class: Polars::List

Inherits:
NestedType show all
Defined in:
lib/polars/data_types.rb

Overview

Nested list/array type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inner) ⇒ List

Returns a new instance of List.



428
429
430
# File 'lib/polars/data_types.rb', line 428

def initialize(inner)
  @inner = Utils.rb_type_to_dtype(inner)
end

Instance Attribute Details

#innerObject (readonly)

Returns the value of attribute inner.



426
427
428
# File 'lib/polars/data_types.rb', line 426

def inner
  @inner
end

Instance Method Details

#==(other) ⇒ Object



432
433
434
435
436
437
438
439
440
# File 'lib/polars/data_types.rb', line 432

def ==(other)
  if other.eql?(List)
    true
  elsif other.is_a?(List)
    @inner.nil? || other.inner.nil? || @inner == other.inner
  else
    false
  end
end

#to_sObject



442
443
444
# File 'lib/polars/data_types.rb', line 442

def to_s
  "#{self.class.name}(#{inner})"
end