debian-mirror-gitlab/app/services/feature_flags/hook_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
542 B
Ruby
Raw Normal View History

2021-11-18 22:05:49 +05:30
# frozen_string_literal: true
module FeatureFlags
class HookService
HOOK_NAME = :feature_flag_hooks
def initialize(feature_flag, current_user)
@feature_flag = feature_flag
@current_user = current_user
end
def execute
project.execute_hooks(hook_data, HOOK_NAME)
end
private
attr_reader :feature_flag, :current_user
def project
@project ||= feature_flag.project
end
def hook_data
Gitlab::DataBuilder::FeatureFlag.build(feature_flag, current_user)
end
end
end