Class: GemPlugin::Base

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

Overview

This base class for plugins really 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.



264
265
266
# File 'lib/gem_plugin.rb', line 264

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



249
250
251
# File 'lib/gem_plugin.rb', line 249

def options
  @options
end

Class Method Details

.category=(category) ⇒ Object

See Mongrel::Plugin for an explanation.



260
261
262
# File 'lib/gem_plugin.rb', line 260

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

.inherited(klass) ⇒ Object

See Mongrel::Plugin for an explanation.



253
254
255
256
257
# File 'lib/gem_plugin.rb', line 253

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