Class: GemPlugin::Base

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

Overview

This base class for plugins reallys does nothing more than wire up the new class into the right category. It is not thread-safe yet but will be soon.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



177
178
179
# File 'lib/gem_plugin.rb', line 177

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



162
163
164
# File 'lib/gem_plugin.rb', line 162

def options
  @options
end

Class Method Details

.category=(category) ⇒ Object

See Mongrel::Plugin for an explanation.



173
174
175
# File 'lib/gem_plugin.rb', line 173

def Base.category=(category)
  @@category = category
end

.inherited(klass) ⇒ Object

See Mongrel::Plugin for an explanation.



166
167
168
169
170
# File 'lib/gem_plugin.rb', line 166

def Base.inherited(klass)
  name = "/" + klass.to_s.downcase
  Manager.instance.register(@@category, name, klass)
  @@category = nil
end