Class: DuckDB::ScalarFunctionSet
- Inherits:
-
Object
- Object
- DuckDB::ScalarFunctionSet
- Defined in:
- lib/duckdb/scalar_function_set.rb,
ext/duckdb/scalar_function_set.c
Overview
Note:
DuckDB::ScalarFunctionSet is experimental.
DuckDB::ScalarFunctionSet encapsulates DuckDB’s scalar function set, which allows registering multiple overloads of a scalar function under one name.
Instance Method Summary collapse
- #add(scalar_function) ⇒ self
-
#initialize(name) ⇒ ScalarFunctionSet
constructor
A new instance of ScalarFunctionSet.
Constructor Details
#initialize(name) ⇒ ScalarFunctionSet
Returns a new instance of ScalarFunctionSet.
11 12 13 14 15 16 |
# File 'lib/duckdb/scalar_function_set.rb', line 11 def initialize(name) raise TypeError, "#{name.class} is not a String or Symbol" unless name.is_a?(String) || name.is_a?(Symbol) @name = name.to_s _initialize(@name) end |
Instance Method Details
#add(scalar_function) ⇒ self
22 23 24 25 26 27 28 29 |
# File 'lib/duckdb/scalar_function_set.rb', line 22 def add(scalar_function) unless scalar_function.is_a?(DuckDB::ScalarFunction) raise TypeError, "#{scalar_function.class} is not a DuckDB::ScalarFunction" end scalar_function.name = @name _add(scalar_function) end |