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

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



14
15
16
17
# File 'lib/qonfig/settings/callbacks.rb', line 14

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



32
33
34
# File 'lib/qonfig/settings/callbacks.rb', line 32

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



23
24
25
# File 'lib/qonfig/settings/callbacks.rb', line 23

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