Class DataMapper::Adapters::RedisAdapter
In: lib/dm-redis-adapter/adapter.rb
Parent: AbstractAdapter

Methods

create   delete   new   read   update  

Public Class methods

Make a new instance of the adapter. The @redis ivar is the ‘data-store’ for this adapter.

@param [String, Symbol] name

  The name of the Repository using this adapter.

@param [String, Hash] uri_or_options

  The connection uri string, or a hash of options to set up
  the adapter

@api semipublic

Public Instance methods

Used by DataMapper to put records into the redis data-store: "INSERT" in SQL-speak. It takes an array of the resources (model instances) to be saved. Resources each have a key that can be used to quickly look them up later without searching.

@param [Enumerable(Resource)] resources

  The set of resources (model instances)

@api semipublic

Destroys all the records matching the given query. "DELETE" in SQL.

@param [DataMapper::Collection] collection

  The query used to locate the resources to be deleted.

@return [Array]

  An Array of Hashes containing the key-value pairs for
  each record

@api semipublic

Looks up one record or a collection of records from the data-store: "SELECT" in SQL.

@param [Query] query

  The query to be used to seach for the resources

@return [Array]

  An Array of Hashes containing the key-value pairs for
  each record

@api semipublic

Used by DataMapper to update the attributes on existing records in the redis data-store: "UPDATE" in SQL-speak. It takes a hash of the attributes to update with, as well as a collection object that specifies which resources should be updated.

@param [Hash] attributes

  A set of key-value pairs of the attributes to update the resources with.

@param [DataMapper::Collection] collection

  The collection object that should be used to find the resource(s) to update.

@api semipublic

[Validate]