Class: Line::Matchers::Or
- Inherits:
-
Object
- Object
- Line::Matchers::Or
- Includes:
- Helpers
- Defined in:
- lib/line/matchers/or.rb
Instance Method Summary collapse
-
#initialize(matcher1, matcher2) ⇒ Or
constructor
A new instance of Or.
- #inspect(parent = false) ⇒ Object
- #matches?(*args) ⇒ Boolean
Methods included from Helpers
Constructor Details
#initialize(matcher1, matcher2) ⇒ Or
Returns a new instance of Or.
8 9 10 |
# File 'lib/line/matchers/or.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/or.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/or.rb', line 12 def matches?(*args) @matcher1.matches?(*args) || @matcher2.matches?(*args) end |