Class: Line::Matchers::And
- Inherits:
-
Object
- Object
- Line::Matchers::And
- Includes:
- Helpers
- Defined in:
- lib/line/matchers/and.rb
Instance Method Summary collapse
-
#initialize(matcher1, matcher2) ⇒ And
constructor
A new instance of And.
- #inspect(parent = false) ⇒ Object
- #matches?(*args) ⇒ Boolean
Methods included from Helpers
Constructor Details
#initialize(matcher1, matcher2) ⇒ And
Returns a new instance of And.
8 9 10 |
# File 'lib/line/matchers/and.rb', line 8 def initialize(matcher1, matcher2) @matcher1, @matcher2 = matcher1, matcher2 end |
Instance Method Details
#inspect(parent = false) ⇒ Object
16 17 18 |
# File 'lib/line/matchers/and.rb', line 16 def inspect(parent=false) inspect_helper parent, "#{@matcher1.inspect self} && #{@matcher2.inspect self}", true end |
#matches?(*args) ⇒ Boolean
12 13 14 |
# File 'lib/line/matchers/and.rb', line 12 def matches?(*args) @matcher1.matches?(*args) && @matcher2.matches?(*args) end |