Class: Cucumber::Hooks::BeforeHook

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ BeforeHook

Returns a new instance of BeforeHook.



59
60
61
# File 'lib/cucumber/hooks.rb', line 59

def initialize(location)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



57
58
59
# File 'lib/cucumber/hooks.rb', line 57

def location
  @location
end

Instance Method Details

#describe_to(visitor, *args) ⇒ Object



71
72
73
# File 'lib/cucumber/hooks.rb', line 71

def describe_to(visitor, *args)
  visitor.before_hook(self, *args)
end

#match_locations?(queried_locations) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/cucumber/hooks.rb', line 67

def match_locations?(queried_locations)
  queried_locations.any? { |other_location| other_location.match?(location) }
end

#nameObject



63
64
65
# File 'lib/cucumber/hooks.rb', line 63

def name
  "Before hook"
end