Class: Axiom::Function::Predicate::Match

Inherits:
Axiom::Function::Predicate show all
Includes:
Comparable
Defined in:
lib/axiom/function/predicate/match.rb

Overview

A predicate representing a regexp match between operands

Defined Under Namespace

Modules: Methods

Instance Attribute Summary

Attributes included from Operation::Binary

#left, #right

Class Method Summary collapse

Methods inherited from Axiom::Function::Predicate

type

Methods included from Binary::Invertible

#inverse

Methods included from Binary

#call, #rename, #type

Methods included from Operation::Binary

#initialize

Methods included from Connective::Conjunction::Methods

#and

Methods included from Aliasable

#inheritable_alias

Methods included from Connective::Disjunction::Methods

#or

Methods included from Connective::Negation::Methods

#not

Methods inherited from Axiom::Function

extract_value, rename_attributes, #type

Methods included from Visitable

#accept

Class Method Details

.callBoolean

Evaluate the left and right value to see if they match

Examples:

matches = Match.call(left, right)

Returns:

  • (Boolean)


19
20
21
# File 'lib/axiom/function/predicate/match.rb', line 19

def self.call(*)
  super ? true : false
end

.inverseClass<NoMatch>

Return the inverse predicate class

Examples:

Match.inverse  # => NoMatch

Returns:



43
44
45
# File 'lib/axiom/function/predicate/match.rb', line 43

def self.inverse
  NoMatch
end

.operationSymbol

Return the Match operation

Examples:

Match.operation  # => :=~

Returns:

  • (Symbol)


31
32
33
# File 'lib/axiom/function/predicate/match.rb', line 31

def self.operation
  :=~
end