Class: ActiveMutator::SubjectMatcher
- Inherits:
-
Object
- Object
- ActiveMutator::SubjectMatcher
- Defined in:
- lib/active_mutator/subject_matcher.rb
Overview
Tiny subject-expression grammar for --subject:
Foo::Bar#baz exact Foo::Bar all methods of the constant
Foo::Bar* namespace Foo::Bar#* instance-only Foo::Bar.* singleton-only
Instance Method Summary collapse
-
#initialize(expression) ⇒ SubjectMatcher
constructor
A new instance of SubjectMatcher.
- #match?(name) ⇒ Boolean
Constructor Details
#initialize(expression) ⇒ SubjectMatcher
Returns a new instance of SubjectMatcher.
6 7 8 |
# File 'lib/active_mutator/subject_matcher.rb', line 6 def initialize(expression) @regexp = compile(expression) end |
Instance Method Details
#match?(name) ⇒ Boolean
10 |
# File 'lib/active_mutator/subject_matcher.rb', line 10 def match?(name) = @regexp.match?(name) |