Class: Machete::Matchers::IndifferentRegexpMatcher

Inherits:
RegexpMatcher show all
Defined in:
lib/machete/matchers.rb

Instance Attribute Summary

Attributes inherited from RegexpMatcher

#regexp

Instance Method Summary collapse

Methods inherited from RegexpMatcher

#==, #initialize

Constructor Details

This class inherits a constructor from Machete::Matchers::RegexpMatcher

Instance Method Details

#matches?(node) ⇒ Boolean

Returns:

  • (Boolean)


161
162
163
164
# File 'lib/machete/matchers.rb', line 161

def matches?(node)
  (node.is_a?(Symbol) && node.to_s =~ @regexp) ||
  (node.is_a?(String) && node =~ @regexp)
end