Class: ModSpox::PluginHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/mod_spox/PluginHolder.rb

Overview

Holder for plugin

Instance Method Summary collapse

Constructor Details

#initialize(plugin) ⇒ PluginHolder

Create a new holder with a plugin



5
6
7
8
# File 'lib/mod_spox/PluginHolder.rb', line 5

def initialize(plugin)
    @plugin = plugin
    @lock = Mutex.new
end

Instance Method Details

#pluginObject

Returns the plugin this holder contains



16
17
18
19
20
# File 'lib/mod_spox/PluginHolder.rb', line 16

def plugin
    @lock.synchronize do
        return @plugin
    end
end

#set_plugin(plugin) ⇒ Object

plugin

Plugin to set into this holder



10
11
12
13
14
# File 'lib/mod_spox/PluginHolder.rb', line 10

def set_plugin(plugin)
    @lock.synchronize do
        @plugin = plugin
    end
end