Class: Algebrick::Matchers::Not
- Defined in:
- lib/algebrick/matchers/not.rb
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
Attributes inherited from Abstract
Instance Method Summary collapse
- #==(other) ⇒ Object
- #children ⇒ Object
-
#initialize(matcher) ⇒ Not
constructor
A new instance of Not.
- #to_s ⇒ Object
Methods inherited from Abstract
#!, #&, #===, #>, #assign!, #assign?, #assign_to_s, #assigned?, #assigns, #case, #children_including_self, #inspect, #matched?, #to_a, #|
Methods included from TypeCheck
#Child!, #Child?, #Match!, #Match?, #Type!, #Type?
Constructor Details
#initialize(matcher) ⇒ Not
Returns a new instance of Not.
20 21 22 |
# File 'lib/algebrick/matchers/not.rb', line 20 def initialize(matcher) @matcher = matcher end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
18 19 20 |
# File 'lib/algebrick/matchers/not.rb', line 18 def matcher @matcher end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 |
# File 'lib/algebrick/matchers/not.rb', line 32 def ==(other) other.kind_of? self.class and self.matcher == other.matcher end |
#children ⇒ Object
24 25 26 |
# File 'lib/algebrick/matchers/not.rb', line 24 def children [] end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/algebrick/matchers/not.rb', line 28 def to_s '!' + matcher.to_s end |