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

#initialize(block, options) ⇒ Hook

Returns 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

#blockObject (readonly)

Returns the value of attribute block


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

def block
  @block
end

#optionsObject (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

#options_apply?(example_or_group) ⇒ Boolean

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