You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: active_hook_filter.rb
    path of file: ./repos/gitlabhq/app/models/hooks
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ActiveHookFilter
  def initialize(hook)
    @hook = hook
  end

  def matches?(hooks_scope, data)
    return true unless hooks_scope == :push_hooks

    matches_branch?(data)
  e
    
  def matches_branch?(data)
    return true if @hook.push_events_branch_filter.blank?

    branch_name = Gitlab::Git.branch_name(data[:ref])

    case @hook.branch_filter_strategy
    when 'all_branches'
      true
    when 'wildcard'
      RefMatcher.new(@hook.push_events_branch_filter).matches?(branch_name)
    when 'regex'
      begin
        Gitlab::UntrustedRegexp.new(@hook.push_events_branch_filter) === branch_name
      rescue RegexpError
        false
      end