Class: Crew::Tester::Preparer
- Inherits:
-
Object
- Object
- Crew::Tester::Preparer
- Defined in:
- lib/crew/tester/preparer.rb,
lib/crew/tester/preparer/dsl.rb
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#setup ⇒ Object
Returns the value of attribute setup.
Instance Method Summary collapse
- #add_exclude(exl) ⇒ Object
- #add_include(inc) ⇒ Object
-
#initialize(name) ⇒ Preparer
constructor
A new instance of Preparer.
- #load(&blk) ⇒ Object
- #match?(name) ⇒ Boolean
Constructor Details
#initialize(name) ⇒ Preparer
Returns a new instance of Preparer.
8 9 10 11 12 |
# File 'lib/crew/tester/preparer.rb', line 8 def initialize(name) @name = name @includes = [] @excludes = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/crew/tester/preparer.rb', line 5 def name @name end |
#setup ⇒ Object
Returns the value of attribute setup.
6 7 8 |
# File 'lib/crew/tester/preparer.rb', line 6 def setup @setup end |
Instance Method Details
#add_exclude(exl) ⇒ Object
27 28 29 |
# File 'lib/crew/tester/preparer.rb', line 27 def add_exclude(exl) @excludes << exl end |
#add_include(inc) ⇒ Object
23 24 25 |
# File 'lib/crew/tester/preparer.rb', line 23 def add_include(inc) @includes << inc end |
#load(&blk) ⇒ Object
14 15 16 |
# File 'lib/crew/tester/preparer.rb', line 14 def load(&blk) DSL.new(self).load(&blk) end |
#match?(name) ⇒ Boolean
18 19 20 21 |
# File 'lib/crew/tester/preparer.rb', line 18 def match?(name) included = @includes.any? { |inc| inc == :all or inc === name } included and !@excludes.any? { |exl| exl === name } end |