Class: Mutant::CLI::Builder
- Inherits:
-
Object
- Object
- Mutant::CLI::Builder
- Includes:
- NodeHelpers
- Defined in:
- lib/mutant/cli.rb
Overview
Builder for configuration components
Constant Summary
Constants included from NodeHelpers
NodeHelpers::INFINITY, NodeHelpers::NAN, NodeHelpers::NEGATIVE_INFINITY, NodeHelpers::N_EMPTY, NodeHelpers::N_FALSE, NodeHelpers::N_NIL, NodeHelpers::N_SELF, NodeHelpers::N_TRUE, NodeHelpers::RAISE
Instance Method Summary collapse
-
#add_matcher(matcher) ⇒ self
private
Add a subject matcher.
-
#add_subject_ignore(matcher) ⇒ self
private
Add a subject ignore.
-
#add_subject_selector(selector) ⇒ self
private
Add a subject selector.
-
#initialize ⇒ undefined
constructor
private
Initalize object.
-
#matcher ⇒ Mutant::Matcher
private
Return generated matcher.
Methods included from NodeHelpers
Constructor Details
#initialize ⇒ undefined
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.
Initalize object
45 46 47 48 49 |
# File 'lib/mutant/cli.rb', line 45 def initialize @matchers = [] @subject_ignores = [] @subject_selectors = [] end |
Instance Method Details
#add_matcher(matcher) ⇒ 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.
Add a subject matcher
85 86 87 88 |
# File 'lib/mutant/cli.rb', line 85 def add_matcher(matcher) @matchers << matcher self end |
#add_subject_ignore(matcher) ⇒ 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.
Add a subject ignore
59 60 61 62 |
# File 'lib/mutant/cli.rb', line 59 def add_subject_ignore(matcher) @subject_ignores << matcher self end |
#add_subject_selector(selector) ⇒ 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.
Add a subject selector
72 73 74 75 |
# File 'lib/mutant/cli.rb', line 72 def add_subject_selector(selector) @subject_selectors << selector self end |
#matcher ⇒ Mutant::Matcher
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 generated matcher
96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/mutant/cli.rb', line 96 def matcher if @matchers.empty? raise(Error, 'No patterns given') end matcher = Matcher::Chain.build(@matchers) if predicate Matcher::Filter.new(matcher, predicate) else matcher end end |