Class: Mutant::Matcher::ObjectSpace
- Inherits:
-
Mutant::Matcher
- Object
- Mutant::Matcher
- Mutant::Matcher::ObjectSpace
- Defined in:
- lib/mutant/matcher/object_space.rb
Overview
Matcher against object space
Constant Summary collapse
- PATTERN =
%r(\A::(.+)\z)
Class Method Summary collapse
-
.parse(input) ⇒ Matcher::ObjectSpace?
private
Parse matcher.
Instance Method Summary collapse
-
#each(&block) ⇒ Enumerator<Subject>, self
private
Enumerate subjects.
-
#scope_name_pattern ⇒ Regexp
private
Return scope name pattern.
Methods inherited from Mutant::Matcher
Class Method Details
.parse(input) ⇒ Matcher::ObjectSpace?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parse matcher
21 22 23 24 25 26 |
# File 'lib/mutant/matcher/object_space.rb', line 21 def self.parse(input) match = PATTERN.match(input) return unless match new(%r(\A#{Regexp.escape(match[1])}(\z|::))) end |
Instance Method Details
#each(&block) ⇒ Enumerator<Subject>, self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Enumerate subjects
38 39 40 41 42 43 44 45 46 |
# File 'lib/mutant/matcher/object_space.rb', line 38 def each(&block) return to_enum unless block_given? scopes.each do |scope| emit_scope_matches(scope, &block) end self end |
#scope_name_pattern ⇒ Regexp
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return scope name pattern
54 |
# File 'lib/mutant/matcher/object_space.rb', line 54 def scope_name_pattern; @scope_name_pattern; end |