Sha256: 22b1abb0c8b72cd5334746437672d6170d4917f8e9d9df99688cd663b6c80299
Contents?: true
Size: 696 Bytes
Versions: 16
Compression:
Stored size: 696 Bytes
Contents
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.io/terms.html module Sqreen module Dependency class Callback attr_reader :name def initialize(name = nil, &block) @name = name @block = block @disabled = false end def call(*args, &block) Sqreen.log.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