class Machete::Matchers::ChoiceMatcher
Attributes
alternatives[R]
Public Class Methods
new(alternatives)
click to toggle source
# File lib/machete/matchers.rb, line 26 def initialize(alternatives) @alternatives = alternatives end
Public Instance Methods
==(other)
click to toggle source
# File lib/machete/matchers.rb, line 30 def ==(other) other.instance_of?(self.class) && @alternatives == other.alternatives end
matches?(node)
click to toggle source
# File lib/machete/matchers.rb, line 34 def matches?(node) @alternatives.any? { |a| a.matches?(node) } end