Class: Polars::DataType
- Inherits:
-
Object
- Object
- Polars::DataType
- Defined in:
- lib/polars/data_types.rb
Overview
Base class for all Polars data types.
Direct Known Subclasses
Binary, Boolean, Categorical, Enum, NestedType, Null, NumericType, Object, String, TemporalType, Unknown
Class Method Summary collapse
-
.==(other) ⇒ Boolean
Check if this DataType is the same as another DataType.
-
.base_type ⇒ Class
Return this DataType's fundamental/root type class.
-
.decimal? ⇒ Boolean
Check whether the data type is a decimal type.
-
.float? ⇒ Boolean
Check whether the data type is a float type.
-
.integer? ⇒ Boolean
Check whether the data type is an integer type.
-
.nested? ⇒ Boolean
Check whether the data type is a nested type.
-
.numeric? ⇒ Boolean
Check whether the data type is a numeric type.
-
.signed_integer? ⇒ Boolean
Check whether the data type is a signed integer type.
-
.temporal? ⇒ Boolean
Check whether the data type is a temporal type.
-
.unsigned_integer? ⇒ Boolean
Check whether the data type is an unsigned integer type.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Check if this DataType is the same as another DataType.
-
#base_type ⇒ Class
Return this DataType's fundamental/root type class.
-
#inspect ⇒ String
Returns a string representing the data type.
-
#to_s ⇒ String
Returns a string representing the data type.
Class Method Details
.==(other) ⇒ Boolean
Check if this DataType is the same as another DataType.
31 32 33 |
# File 'lib/polars/data_types.rb', line 31 def self.==(other) eql?(other) || other.is_a?(self) end |
.base_type ⇒ Class
Return this DataType's fundamental/root type class.
17 18 19 |
# File 'lib/polars/data_types.rb', line 17 def self.base_type self end |
.decimal? ⇒ Boolean
Check whether the data type is a decimal type.
56 57 58 |
# File 'lib/polars/data_types.rb', line 56 def self.decimal? self == Decimal end |
.float? ⇒ Boolean
Check whether the data type is a float type.
84 85 86 |
# File 'lib/polars/data_types.rb', line 84 def self.float? self < FloatType end |
.integer? ⇒ Boolean
Check whether the data type is an integer type.
63 64 65 |
# File 'lib/polars/data_types.rb', line 63 def self.integer? self < IntegerType end |
.nested? ⇒ Boolean
Check whether the data type is a nested type.
98 99 100 |
# File 'lib/polars/data_types.rb', line 98 def self.nested? self < NestedType end |
.numeric? ⇒ Boolean
Check whether the data type is a numeric type.
49 50 51 |
# File 'lib/polars/data_types.rb', line 49 def self.numeric? self < NumericType end |
.signed_integer? ⇒ Boolean
Check whether the data type is a signed integer type.
70 71 72 |
# File 'lib/polars/data_types.rb', line 70 def self.signed_integer? self < SignedIntegerType end |
.temporal? ⇒ Boolean
Check whether the data type is a temporal type.
91 92 93 |
# File 'lib/polars/data_types.rb', line 91 def self.temporal? self < TemporalType end |
.unsigned_integer? ⇒ Boolean
Check whether the data type is an unsigned integer type.
77 78 79 |
# File 'lib/polars/data_types.rb', line 77 def self.unsigned_integer? self < UnsignedIntegerType end |
Instance Method Details
#==(other) ⇒ Boolean
Check if this DataType is the same as another DataType.
38 39 40 41 42 43 44 |
# File 'lib/polars/data_types.rb', line 38 def ==(other) if other.is_a?(Class) is_a?(other) else other.instance_of?(self.class) end end |
#base_type ⇒ Class
Return this DataType's fundamental/root type class.
24 25 26 |
# File 'lib/polars/data_types.rb', line 24 def base_type is_a?(DataType) ? self.class : self end |
#inspect ⇒ String
Returns a string representing the data type.
118 119 120 |
# File 'lib/polars/data_types.rb', line 118 def inspect to_s end |
#to_s ⇒ String
Returns a string representing the data type.
111 112 113 |
# File 'lib/polars/data_types.rb', line 111 def to_s self.class.name end |