lib/riak/cache_store.rb in riak-client-0.8.0.beta2 vs lib/riak/cache_store.rb in riak-client-0.8.0
- old
+ new
@@ -10,13 +10,17 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'riak'
+
module Riak
+ # An ActiveSupport::Cache::Store implementation that uses Riak.
+ # Compatible only with ActiveSupport version 3 or greater.
class CacheStore < ActiveSupport::Cache::Store
attr_accessor :client
+ # Creates a Riak-backed cache store.
def initialize(options = {})
super
@bucket_name = options.delete(:bucket) || '_cache'
@n_value = options.delete(:n_value) || 2
@r = options.delete(:r) || 1