Class: Algebrick::Matchers::And

Inherits:
AbstractLogic show all
Defined in:
lib/algebrick/matchers/and.rb

Instance Attribute Summary

Attributes inherited from AbstractLogic

#matchers

Attributes inherited from Abstract

#value

Instance Method Summary (collapse)

Methods inherited from AbstractLogic

#==, call, #children, #initialize

Methods inherited from Abstract

#!, #&, #==, #===, #>, #assign!, #assign?, #assign_to_s, #assigned?, #assigns, #case, #children, #children_including_self, #collect_assigns, #find_children, #initialize, #inspect, #matchable!, #matched?, #to_a, #|

Methods included from TypeCheck

#Child!, #Child?, #Match!, #Match?, #Type!, #Type?, error

Constructor Details

This class inherits a constructor from Algebrick::Matchers::AbstractLogic

Instance Method Details

- (Boolean) matching?(other) (protected)

Returns:



24
25
26
# File 'lib/algebrick/matchers/and.rb', line 24

def matching?(other)
  matchers.all? { |m| m === other }
end

- (Object) to_s



18
19
20
# File 'lib/algebrick/matchers/and.rb', line 18

def to_s
  matchers.join ' & '
end