Class: Polars::Array
- Inherits:
-
NestedType
- Object
- DataType
- NestedType
- Polars::Array
- Defined in:
- lib/polars/data_types.rb
Overview
Nested list/array type.
Instance Attribute Summary collapse
-
#inner ⇒ Object
readonly
Returns the value of attribute inner.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#==(other) ⇒ Object
TODO check width?.
-
#initialize(width, inner = nil) ⇒ Array
constructor
A new instance of Array.
-
#to_s ⇒ Object
TODO add width?.
Constructor Details
#initialize(width, inner = nil) ⇒ Array
233 234 235 236 |
# File 'lib/polars/data_types.rb', line 233 def initialize(width, inner = nil) @width = width @inner = Utils.rb_type_to_dtype(inner) if inner end |
Instance Attribute Details
#inner ⇒ Object (readonly)
Returns the value of attribute inner.
231 232 233 |
# File 'lib/polars/data_types.rb', line 231 def inner @inner end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
231 232 233 |
# File 'lib/polars/data_types.rb', line 231 def width @width end |
Instance Method Details
#==(other) ⇒ Object
TODO check width?
239 240 241 242 243 244 245 246 247 |
# File 'lib/polars/data_types.rb', line 239 def ==(other) if other.eql?(Array) true elsif other.is_a?(Array) @inner.nil? || other.inner.nil? || @inner == other.inner else false end end |
#to_s ⇒ Object
TODO add width?
250 251 252 |
# File 'lib/polars/data_types.rb', line 250 def to_s "#{self.class.name}(#{inner})" end |