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