Class: Polars::Struct
- Inherits:
-
NestedType
- Object
- DataType
- NestedType
- Polars::Struct
- Defined in:
- lib/polars/data_types.rb
Overview
Struct composite type.
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(fields) ⇒ Struct
constructor
A new instance of Struct.
- #to_s ⇒ Object
- #to_schema ⇒ Object
Constructor Details
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
438 439 440 |
# File 'lib/polars/data_types.rb', line 438 def fields @fields end |
Instance Method Details
#==(other) ⇒ Object
448 449 450 451 452 453 454 455 456 |
# File 'lib/polars/data_types.rb', line 448 def ==(other) if other.eql?(Struct) true elsif other.is_a?(Struct) fields == other.fields else false end end |
#to_s ⇒ Object
458 459 460 |
# File 'lib/polars/data_types.rb', line 458 def to_s "#{self.class.name}(#{fields.to_h { |f| [f.name, f.dtype] }})" end |
#to_schema ⇒ Object
462 463 464 |
# File 'lib/polars/data_types.rb', line 462 def to_schema @fields.to_h { |f| [f.name, f.dtype] } end |