Class: Enygma::Adapters::AbstractAdapter
- Inherits:
-
Object
- Object
- Enygma::Adapters::AbstractAdapter
- Defined in:
- lib/enygma/adapters/abstract_adapter.rb
Direct Known Subclasses
ActiveRecordAdapter, BerkeleyAdapter, DatamapperAdapter, MemcacheAdapter, SequelAdapter, TokyoCabinetAdapter
Defined Under Namespace
Classes: InscrutableRecord, InvalidDatabase
Instance Attribute Summary collapse
-
#datastore ⇒ Object
readonly
Returns the value of attribute datastore.
Instance Method Summary collapse
Instance Attribute Details
#datastore ⇒ Object (readonly)
Returns the value of attribute datastore.
9 10 11 |
# File 'lib/enygma/adapters/abstract_adapter.rb', line 9 def datastore @datastore end |
Instance Method Details
#connect!(datastore) ⇒ Object
11 12 13 |
# File 'lib/enygma/adapters/abstract_adapter.rb', line 11 def connect!(datastore) @datastore = nil end |
#get_attribute(record, attribute) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/enygma/adapters/abstract_adapter.rb', line 19 def get_attribute(record, attribute) if record.respond_to?(attribute.to_sym) record.__send__(attribute.to_sym) elsif record.respond_to?(:[]) record[attribute] else raise InscrutableRecord, "Attribute \"#{attribute}\" could not be extracted for record #{record.inspect}." end end |
#query(args = {}) ⇒ Object
15 16 17 |
# File 'lib/enygma/adapters/abstract_adapter.rb', line 15 def query(args = {}) [] end |