Class: Veritas::Function::String::Length
- Inherits:
-
Veritas::Function
- Object
- Veritas::Function
- Veritas::Function::String::Length
- Includes:
- Unary
- Defined in:
- lib/veritas/function/string/length.rb
Overview
A class representing a length function
Defined Under Namespace
Modules: Methods
Instance Attribute Summary
Attributes included from Operation::Unary
Class Method Summary collapse
-
.call(value) ⇒ Integer
Return the string length.
Instance Method Summary collapse
-
#inspect ⇒ String
Return a string representing the length function.
-
#type ⇒ Class<Attribute::Integer>
Return the type returned from #call.
Methods included from Unary
Methods included from Comparator
Methods included from Unary::Callable
Methods included from Operation::Unary
Methods included from Immutable
#dup, #freeze, included, #memoize, #memoized
Methods inherited from Veritas::Function
extract_value, #rename, rename_attributes
Methods included from AbstractClass
Methods included from Visitable
Class Method Details
.call(value) ⇒ Integer
Return the string length
21 22 23 |
# File 'lib/veritas/function/string/length.rb', line 21 def self.call(value) value.length end |
Instance Method Details
#inspect ⇒ String
Return a string representing the length function
42 43 44 |
# File 'lib/veritas/function/string/length.rb', line 42 def inspect "LENGTH(#{operand.inspect})" end |
#type ⇒ Class<Attribute::Integer>
Return the type returned from #call
30 31 32 |
# File 'lib/veritas/function/string/length.rb', line 30 def type Attribute::Integer end |