Class: Axiom::Function::String::Length

Inherits:
Axiom::Function show all
Includes:
Unary
Defined in:
lib/axiom/function/string/length.rb

Overview

A class representing a length function

Defined Under Namespace

Modules: Methods

Instance Attribute Summary

Attributes included from Operation::Unary

#operand

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Unary

#call, #rename

Methods included from Unary::Callable

#call, #included

Methods included from Operation::Unary

#initialize

Methods inherited from Axiom::Function

extract_value, rename_attributes

Methods included from Visitable

#accept

Class Method Details

.call(value) ⇒ Integer

Return the string length

Examples:

length = Length.call(value)

Parameters:

Returns:

  • (Integer)


21
22
23
# File 'lib/axiom/function/string/length.rb', line 21

def self.call(value)
  value.length
end

Instance Method Details

#typeClass<Attribute::Integer>

Return the type returned from #call

Returns:



30
31
32
# File 'lib/axiom/function/string/length.rb', line 30

def type
  Attribute::Integer
end