Sha256: 05e4432c910e7aa7bacd140ab193bbfdc28b473d32e3ad8a56b5ee7582c2c5af
Contents?: true
Size: 950 Bytes
Versions: 16
Compression:
Stored size: 950 Bytes
Contents
# typed: false # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/graft' module Sqreen module Graft class Callback attr_reader :name, :rank, :mandatory, :flow, :ignore def initialize(name = nil, opts = {}, &block) @name = name @rank = opts[:rank] || 0 @mandatory = opts[:mandatory] || false @flow = opts[:flow] || false @ignore = opts[:ignore] || false @block = block @disabled = false end def call(*args, &block) Sqreen::Graft.logger.debug { "[#{Process.pid}] Callback #{@name} disabled:#{disabled?}" } return if @disabled @block.call(*args, &block) end def disable @disabled = true end def enable @disabled = false end def disabled? @disabled end end end end
Version data entries
16 entries across 16 versions & 1 rubygems