Class: ZergGemPlugin::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/zerg/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.



313
314
315
# File 'lib/zerg/gem_plugin.rb', line 313

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



298
299
300
# File 'lib/zerg/gem_plugin.rb', line 298

def options
  @options
end

Class Method Details

.category=(category) ⇒ Object

See Mongrel::Plugin for an explanation.



309
310
311
# File 'lib/zerg/gem_plugin.rb', line 309

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

.inherited(klass) ⇒ Object

See Mongrel::Plugin for an explanation.



302
303
304
305
306
# File 'lib/zerg/gem_plugin.rb', line 302

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