Module: Troles::Strategy::BaseMany
- Defined in:
- lib/troles/strategy.rb
Class Method Summary collapse
-
.included(base) ⇒ Object
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.
Instance Method Summary collapse
-
#storage ⇒ Class
The storage strategy class.
-
#store ⇒ Troles::Storage
The storage to use.
Class Method Details
.included(base) ⇒ Object
Note:
the Trole::Api also includes the Troles::Common::Api
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
20 21 22 |
# File 'lib/troles/strategy.rb', line 20 def self.included(base) base.send :include, Troles::Api end |
Instance Method Details
#storage ⇒ Class
Returns the storage strategy class.
31 32 33 |
# File 'lib/troles/strategy.rb', line 31 def storage raise "Must be implemented by subclass" # Troles::Storage::BaseMany end |
#store ⇒ Troles::Storage
The storage to use
26 27 28 |
# File 'lib/troles/strategy.rb', line 26 def store @store ||= storage.new self end |