Class: RSpec::Core::Hooks::Hook

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/hooks.rb

Direct Known Subclasses

AfterAllHook, AfterHook, AroundHook, BeforeHook

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Hook) initialize(block, options)

A new instance of Hook



9
10
11
12
# File 'lib/rspec/core/hooks.rb', line 9

def initialize(block, options)
  @block = block
  @options = options
end

Instance Attribute Details

- (Object) block (readonly)

Returns the value of attribute block



7
8
9
# File 'lib/rspec/core/hooks.rb', line 7

def block
  @block
end

- (Object) options (readonly)

Returns the value of attribute options



7
8
9
# File 'lib/rspec/core/hooks.rb', line 7

def options
  @options
end

Instance Method Details

- (Boolean) options_apply?(example_or_group)

Returns:

  • (Boolean)


14
15
16
# File 'lib/rspec/core/hooks.rb', line 14

def options_apply?(example_or_group)
  example_or_group.all_apply?(options)
end