Module: Clustr::Adapter
- Defined in:
- lib/clustr/adapter.rb,
lib/clustr/adapter/base.rb,
lib/clustr/adapter/simpledb.rb
Overview
Contains different adapters for controlling the underlying logic for determining current members and adding new members to a cluster through the usage of different technologies, such as SimpleDB.
Defined Under Namespace
Class Method Summary collapse
-
.[](adapter) ⇒ class
Return the constantized adapter class.
-
.exists?(adapter) ⇒ boolean
Determines if the named adapter that has been passed in is a defined and implemented Adapter.
-
.from_options(options) ⇒ object
Instantiates and returns a new Adapter class which has been determined from the options hash that has been passed in.
Class Method Details
.[](adapter) ⇒ class
Return the constantized adapter class.
38 39 40 |
# File 'lib/clustr/adapter.rb', line 38 def self.[](adapter) self.const_get adapter end |
.exists?(adapter) ⇒ boolean
Determines if the named adapter that has been passed in is a defined and implemented Adapter.
48 49 50 |
# File 'lib/clustr/adapter.rb', line 48 def self.exists?(adapter) self.const_defined? adapter end |
.from_options(options) ⇒ object
Note:
The named adapter must equal the defined class name.
Instantiates and returns a new Adapter class which has been determined from the options hash that has been passed in.
28 29 30 31 |
# File 'lib/clustr/adapter.rb', line 28 def self.() name = ["adapter"] self[name].new() end |