module Cucumber::Glue::Dsl

def Before(*tag_expressions, name: nil, &proc)

as you want (typically from ruby scripts under support/hooks.rb).
Registers a proc that will run before each Scenario. You can register as many
def Before(*tag_expressions, name: nil, &proc)
  Dsl.register_rb_hook('before', tag_expressions, proc, name: name)
end