Class: Algebrick::Matchers::Many

Inherits:
Abstract show all
Defined in:
lib/algebrick/matchers/many.rb

Instance Attribute Summary

Attributes inherited from Abstract

#value

Instance Method Summary (collapse)

Methods inherited from Abstract

#!, #&, #===, #>, #assign!, #assign?, #assign_to_s, #assigned?, #assigns, #case, #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::Abstract

Instance Method Details

- (Object) ==(other)



26
27
28
# File 'lib/algebrick/matchers/many.rb', line 26

def ==(other)
  other.kind_of? self.class
end

- (Object) children



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

def children
  []
end

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

Returns:



32
33
34
# File 'lib/algebrick/matchers/many.rb', line 32

def matching?(other)
  true
end

- (Object) to_s



22
23
24
# File 'lib/algebrick/matchers/many.rb', line 22

def to_s
  "*#{assign_to_s}any"
end