class Cucumber::Glue::Hook

def to_envelope(type)

def to_envelope(type)
  Cucumber::Messages::Envelope.new(
    hook: Cucumber::Messages::Hook.new(
      id: id,
      name: name,
      tag_expression: tag_expressions.empty? ? nil : tag_expressions.join(' '),
      type: hook_type_to_enum_value[type.to_sym],
      source_reference: Cucumber::Messages::SourceReference.new(
        uri: location.file,
        location: Cucumber::Messages::Location.new(
          line: location.lines.first
        )
      )
    )
  )
end