Class: Dentaku::AST::StringFunctions::Len
- Defined in:
- lib/dentaku/ast/functions/string_functions.rb
Constant Summary
Constants inherited from Function
Constants inherited from Node
Node::STATIC_CONTEXT, Node::STATIC_MODE_KEY
Instance Attribute Summary
Attributes inherited from Function
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Len
constructor
A new instance of Len.
- #type ⇒ Object
- #value(context = {}) ⇒ Object
Methods inherited from Base
Methods inherited from Function
#accept, #dependencies, get, register, register_class, registry, volatile?
Methods inherited from Node
arity, #dependencies, #name, precedence, #pure?, resolve_class
Constructor Details
#initialize(*args) ⇒ Len
Returns a new instance of Len.
96 97 98 99 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 96 def initialize(*args) super @string = @args[0] end |
Class Method Details
.max_param_count ⇒ Object
92 93 94 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 92 def self.max_param_count 1 end |
.min_param_count ⇒ Object
88 89 90 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 88 def self.min_param_count 1 end |
Instance Method Details
#type ⇒ Object
106 107 108 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 106 def type :numeric end |
#value(context = {}) ⇒ Object
101 102 103 104 |
# File 'lib/dentaku/ast/functions/string_functions.rb', line 101 def value(context = {}) string = @string.value(context).to_s string.length end |