Class: RSpec::Core::Hooks::Hook
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options, &block) ⇒ Hook
Returns a new instance of Hook.
8
9
10
11
|
# File 'lib/rspec/core/hooks.rb', line 8
def initialize(options, &block)
@options = options
@block = block
end
|
Instance Attribute Details
Returns the value of attribute options.
6
7
8
|
# File 'lib/rspec/core/hooks.rb', line 6
def options
@options
end
|
Instance Method Details
21
22
23
|
# File 'lib/rspec/core/hooks.rb', line 21
def call
@block.call
end
|
#options_apply?(example_or_group) ⇒ Boolean
13
14
15
|
# File 'lib/rspec/core/hooks.rb', line 13
def options_apply?(example_or_group)
!example_or_group || example_or_group.apply?(:all?, options)
end
|
17
18
19
|
# File 'lib/rspec/core/hooks.rb', line 17
def to_proc
@block
end
|