debian-mirror-gitlab/app/services/spam/spam_verdict_service.rb

27 lines
470 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
module Spam
class SpamVerdictService
include AkismetMethods
include SpamConstants
def initialize(target:, request:, options:)
@target = target
@request = request
@options = options
end
def execute
if akismet.spam?
Gitlab::Recaptcha.enabled? ? REQUIRE_RECAPTCHA : DISALLOW
else
ALLOW
end
end
private
attr_reader :target, :request, :options
end
end