Class: TestProf::BeforeAll::HooksChain
- Inherits:
-
Object
- Object
- TestProf::BeforeAll::HooksChain
- Defined in:
- lib/test_prof/before_all.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
Returns the value of attribute after.
-
#before ⇒ Object
readonly
Returns the value of attribute before.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type) ⇒ HooksChain
constructor
A new instance of HooksChain.
- #run(scope = nil, metadata = []) ⇒ Object
Constructor Details
#initialize(type) ⇒ HooksChain
Returns a new instance of HooksChain.
111 112 113 114 115 |
# File 'lib/test_prof/before_all.rb', line 111 def initialize(type) @type = type @before = [] @after = [] end |
Instance Attribute Details
#after ⇒ Object (readonly)
Returns the value of attribute after.
109 110 111 |
# File 'lib/test_prof/before_all.rb', line 109 def after @after end |
#before ⇒ Object (readonly)
Returns the value of attribute before.
109 110 111 |
# File 'lib/test_prof/before_all.rb', line 109 def before @before end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
109 110 111 |
# File 'lib/test_prof/before_all.rb', line 109 def type @type end |
Instance Method Details
#run(scope = nil, metadata = []) ⇒ Object
117 118 119 120 121 |
# File 'lib/test_prof/before_all.rb', line 117 def run(scope = nil, = []) before.each { |hook| hook.run(scope, ) } yield after.each { |hook| hook.run(scope, ) } end |