Class: Mongrel::PluginBase

Inherits:
Object
  • Object
show all
Defined in:
lib/mongrel/plugins.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 = {}) ⇒ PluginBase

Returns a new instance of PluginBase.



129
130
131
# File 'lib/mongrel/plugins.rb', line 129

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



114
115
116
# File 'lib/mongrel/plugins.rb', line 114

def options
  @options
end

Class Method Details

.category=(category) ⇒ Object

See Mongrel::Plugin for an explanation.



125
126
127
# File 'lib/mongrel/plugins.rb', line 125

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

.inherited(klass) ⇒ Object

See Mongrel::Plugin for an explanation.



118
119
120
121
122
# File 'lib/mongrel/plugins.rb', line 118

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