module Troles::Strategy::BaseMany

Public Class Methods

included(base) click to toggle source

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)

# File lib/troles/strategy.rb, line 20
def self.included(base)
  base.send :include, Troles::Api
end

Public Instance Methods

storage() click to toggle source

@return [Class] the storage strategy class

# File lib/troles/strategy.rb, line 31
def storage 
  raise "Must be implemented by subclass" # Troles::Storage::BaseMany
end
store() click to toggle source

The storage to use @return [Troles::Storage] a storage subclass instance matching the needs of the strategy

# File lib/troles/strategy.rb, line 26
def store
  @store ||= storage.new self
end