Sha256: 51d8c188d2e28f90f4259458fccdcb3de70cbc20e4654fe1427d3790ba5afe47

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

require 'moneta'
require 'active_support/inflector'

module CanTango
  class Permission
    class MonetaStore < Store
      # one cache store is shared for all store instances (w different names)
      attr_reader :store

      # for a YamlStore, the name is the name of the yml file
      def initialize name, options = {}
        super
        @store = CanTango::Cache::MonetaCache.instance 
        @store.configure_with options
      end

      def self.create name, options = {}
        super
      end

      def load!
        store.load! name
      end

      def store permissions
        store.save! name, permissions.map {|p| p.to_a }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.0 lib/cantango/permission_engine/moneta_store.rb