Sha256: 483bc487f49edb1b91b3990c7819f9e9e8f078d542ca69453c7b2acf33748dc5
Contents?: true
Size: 1.03 KB
Versions: 3
Compression:
Stored size: 1.03 KB
Contents
# @author Kristian Mandrup # # Base module for Many roles strategies # module Troles module Strategy module BaseMany # # a Many role strategy is included by a role subject (fx a UserAccount class) # a Many role strategy should always include BaseMany # when BaseMany is included, it ensures that the complete # Troles API is also included into the role subject # # @note the Trole::Api also includes the Troles::Common::Api # # @param [Class] the role subject class for which to include the Role strategy (fx User Account) # def self.included(base) base.send :include, Troles::Api end # The storage to use # @return [Troles::Storage] a storage subclass instance matching the needs of the strategy def store @store ||= storage.new self end # @return [Class] the storage strategy class def storage raise "Must be implemented by subclass" # Troles::Storage::BaseMany end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
troles-0.5.2 | lib/troles/strategy.rb |
troles-0.5.1 | lib/troles/strategy.rb |
troles-0.5.0 | lib/troles/strategy.rb |