Class: Qonfig::Settings::Callbacks Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/qonfig/settings/callbacks.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.13.0

Defined Under Namespace

Classes: Validation

Instance Method Summary collapse

Constructor Details

#initializevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.13.0



16
17
18
19
# File 'lib/qonfig/settings/callbacks.rb', line 16

def initialize
  @callbacks = []
  @lock = Mutex.new
end

Instance Method Details

#add(callback) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

Since:

  • 0.13.0



34
35
36
# File 'lib/qonfig/settings/callbacks.rb', line 34

def add(callback)
  thread_safe { callbacks << callback }
end

#callvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.13.0



25
26
27
# File 'lib/qonfig/settings/callbacks.rb', line 25

def call
  thread_safe { callbacks.each(&:call) }
end