Class: TestProf::BeforeAll::HookEntry
- Inherits:
-
Object
- Object
- TestProf::BeforeAll::HookEntry
- Defined in:
- lib/test_prof/before_all.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
Instance Method Summary collapse
-
#initialize(block:, filters: []) ⇒ HookEntry
constructor
A new instance of HookEntry.
- #run(scope, metadata) ⇒ Object
Constructor Details
#initialize(block:, filters: []) ⇒ HookEntry
Returns a new instance of HookEntry.
84 85 86 87 |
# File 'lib/test_prof/before_all.rb', line 84 def initialize(block:, filters: []) @block = block @filters = TestProf.rspec? ? ::RSpec::Core::Metadata.build_hash_from(filters) : filters end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
82 83 84 |
# File 'lib/test_prof/before_all.rb', line 82 def block @block end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
82 83 84 |
# File 'lib/test_prof/before_all.rb', line 82 def filters @filters end |
Instance Method Details
#run(scope, metadata) ⇒ Object
89 90 91 92 93 |
# File 'lib/test_prof/before_all.rb', line 89 def run(scope, ) return unless filters_apply?() block.call(scope) end |