Class: Dentaku::AST::StringFunctions::Base

Inherits:
Function show all
Defined in:
lib/dentaku/ast/functions/string_functions.rb

Direct Known Subclasses

Concat, Contains, Find, Left, Len, Mid, Right, Substitute

Constant Summary

Constants inherited from Function

Function::DIG

Instance Method Summary collapse

Methods inherited from Function

#deferred_args, #dependencies, get, #initialize, numeric, register, register_class, registry

Methods inherited from Node

arity, #dependencies, peek, precedence

Constructor Details

This class inherits a constructor from Dentaku::AST::Function

Instance Method Details

#negative_argument_failure(fun, arg = 'length') ⇒ Object

Raises:



11
12
13
14
15
16
# File 'lib/dentaku/ast/functions/string_functions.rb', line 11

def negative_argument_failure(fun, arg = 'length')
  raise Dentaku::ArgumentError.for(
    :invalid_value,
    function_name: "#{fun}()"
  ), "#{fun}() requires #{arg} to be positive"
end

#typeObject



7
8
9
# File 'lib/dentaku/ast/functions/string_functions.rb', line 7

def type
  :string
end