RubyGems Navigation menu

pluggability 0.0.1

Pluggability is a mixin module that turns an including class into a factory for its derivatives, capable of searching for and loading them by name. This is useful when you have an abstract base class which defines an interface and basic functionality for a part of a larger system, and a collection of subclasses which implement the interface for different underlying functionality. An example of where this might be useful is in a program which talks to a database. To avoid coupling it to a specific database, you use a Driver class which encapsulates your program's interaction with the database behind a useful interface. Now you can create a concrete implementation of the Driver class for each kind of database you wish to talk to. If you make the base Driver class a Pluggability, too, you can add new drivers simply by dropping them in a directory and using the Driver's `create` method to instantiate them:

Gemfile
          gem 'pluggability', '~> 0.0.1'
  
  
  
  
  
  
  

install
          gem install pluggability -v 0.0.1
  
  
  
  
  
  
  

Authors:

  • Martin Chase, Michael Granger

Owners:

04cdb622ce0aac272b61f23f373e2abf

ged

Total downloads 4,143

For this version 795

Show all versions (6 total)

Required Ruby Version: None

Links:

Versions:

  1. 0.4.0 - January 8, 2014 (22.5 KB)
  2. 0.3.0 - September 26, 2013 (22.5 KB)
  3. 0.2.0 - March 28, 2013 (21.5 KB)
  4. 0.1.0 - March 27, 2013 (21.5 KB)
  5. 0.0.2 - March 1, 2013 (21.5 KB)
Show all versions (6 total)

Runtime Dependencies: