Class: Polars::Categories

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

Overview

Note:

This functionality is currently considered unstable. It may be changed at any point without it being considered a breaking change.

A named collection of categories for Categorical.

Two categories are considered equal (and will use the same physical mapping of categories to strings) if they have the same name, namespace and physical backing type, even if they are created in separate calls to Categories.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Categories

Returns a new instance of Categories.

Raises:

  • (Todo)


339
340
341
342
343
344
345
346
# File 'lib/polars/data_types.rb', line 339

def initialize(name = nil)
  if name.nil? || name == ""
    self._categories = RbCategories.global_categories
    return
  end

  raise Todo
end

Instance Attribute Details

#_categoriesObject

Returns the value of attribute _categories.



337
338
339
# File 'lib/polars/data_types.rb', line 337

def _categories
  @_categories
end