Class: Cucumber::Hooks::AfterStepHook

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ AfterStepHook

Returns a new instance of AfterStepHook


89
90
91
# File 'lib/cucumber/hooks.rb', line 89

def initialize(location)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location


87
88
89
# File 'lib/cucumber/hooks.rb', line 87

def location
  @location
end

Instance Method Details

#describe_to(visitor, *args) ⇒ Object


105
106
107
# File 'lib/cucumber/hooks.rb', line 105

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

#match_locations?(queried_locations) ⇒ Boolean

Returns:

  • (Boolean)

101
102
103
# File 'lib/cucumber/hooks.rb', line 101

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

#textObject


93
94
95
# File 'lib/cucumber/hooks.rb', line 93

def text
  'AfterStep hook'
end

#to_sObject


97
98
99
# File 'lib/cucumber/hooks.rb', line 97

def to_s
  "#{text} at #{location}"
end