Module: RDFMapper::Adapters
- Defined in:
- lib/lib/adapters/base.rb,
lib/lib/adapters/rest.rb,
lib/lib/adapters/rails.rb,
lib/lib/adapters/sparql.rb
Defined Under Namespace
Classes: Base, REST, Rails, SPARQL
Class Method Summary collapse
-
.[](name) ⇒ Object
Returns adapter’s class based on specified ‘name` (:rails, :sparql, :rest).
-
.register(name, cls, options = {}) ⇒ Object
Instantiates and returns an instance of an adapter.
Class Method Details
.[](name) ⇒ Object
Returns adapter’s class based on specified ‘name` (:rails, :sparql, :rest)
26 27 28 29 30 31 32 33 |
# File 'lib/lib/adapters/base.rb', line 26 def self.[](name) case name when :rails then Rails when :sparql then SPARQL when :rest then REST else raise NameError, 'Adapter `%s` not recognized' % value.inspect end end |
.register(name, cls, options = {}) ⇒ Object
Instantiates and returns an instance of an adapter.
17 18 19 |
# File 'lib/lib/adapters/base.rb', line 17 def self.register(name, cls, = {}) self[name].new(cls, ) end |