module Excom::Plugins::Sentry

Constants

Sentry

Public Class Methods

used(service_class, **opts) click to toggle source
# File lib/excom/plugins/sentry.rb, line 7
def self.used(service_class, **opts)
  klass = opts[:class]

  service_class.use(:status) unless service_class.using?(:status)
  service_class._sentry_class = klass if klass
end

Public Instance Methods

can?(action) click to toggle source
# File lib/excom/plugins/sentry.rb, line 24
def can?(action)
  why_cant?(action).nil?
end
execute(*) click to toggle source
Calls superclass method
# File lib/excom/plugins/sentry.rb, line 14
def execute(*)
  reason = why_cant?(:execute)

  return super if reason.nil?

  failure!(reason)

  self
end
sentry() click to toggle source
# File lib/excom/plugins/sentry.rb, line 32
def sentry
  @sentry ||= self.class.sentry_class.new(self)
end
sentry_hash() click to toggle source
# File lib/excom/plugins/sentry.rb, line 36
def sentry_hash
  sentry.to_hash
end
why_cant?(action) click to toggle source
# File lib/excom/plugins/sentry.rb, line 28
def why_cant?(action)
  sentry.denial_reason(action)
end