docbrown/app/services/ping_admins.rb
2019-10-03 11:18:53 -04:00

25 lines
425 B
Ruby

class PingAdmins
def initialize(user, action = "unknown")
@user = user
@action = action
end
def self.call(*args)
new(*args).call
end
def call
return unless user
SlackBot.ping(
"Rate limit exceeded (#{action}). https://dev.to#{user.path}",
channel: "abuse-reports",
username: "rate_limit",
icon_emoji: ":hand:",
)
end
private
attr_reader :user, :action
end