Class: Wallaby::Mode
- Inherits:
-
Object
- Object
- Wallaby::Mode
- Defined in:
- lib/interfaces/wallaby/mode.rb
Overview
This is the interface that all ORM modes should inherit from and implement.
Direct Known Subclasses
Class Method Summary collapse
-
.default_authorization_provider ⇒ Class
Pagination provider for the mode.
-
.model_authorization_providers(classes = ModelAuthorizationProvider.descendants) ⇒ ActiveSupport::HashWithIndifferentAccess<String, Class>
Return a list of authorization providers for authorizer to detect which one to use.
-
.model_decorator ⇒ Class
Model decorator for the mode.
-
.model_finder ⇒ Class
Model finder for the mode.
-
.model_pagination_provider ⇒ Class
Pagination provider for the mode.
-
.model_service_provider ⇒ Class
Service provider for the mode.
Class Method Details
.default_authorization_provider ⇒ Class
Returns pagination provider for the mode.
35 36 37 |
# File 'lib/interfaces/wallaby/mode.rb', line 35 def check_and_constantize __callee__ end |
.model_authorization_providers(classes = ModelAuthorizationProvider.descendants) ⇒ ActiveSupport::HashWithIndifferentAccess<String, Class>
Return a list of authorization providers for authorizer to detect which one to use.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/interfaces/wallaby/mode.rb', line 43 def (classes = ModelAuthorizationProvider.descendants) # NOTE: make sure default provider always comes last @model_authorization_providers ||= classes .select { |klass| klass.name.include? name } .sort_by { |klass| klass.provider_name == DEFAULT_PROVIDER ? 1 : 0 } .each_with_object(::ActiveSupport::HashWithIndifferentAccess.new) do |klass, hash| hash[klass.provider_name] = klass end end |
.model_decorator ⇒ Class
Returns model decorator for the mode.
9 10 11 |
# File 'lib/interfaces/wallaby/mode.rb', line 9 def model_decorator check_and_constantize __callee__ end |
.model_finder ⇒ Class
Returns model finder for the mode.
15 16 17 |
# File 'lib/interfaces/wallaby/mode.rb', line 15 def model_finder check_and_constantize __callee__ end |
.model_pagination_provider ⇒ Class
Returns pagination provider for the mode.
28 29 30 |
# File 'lib/interfaces/wallaby/mode.rb', line 28 def model_pagination_provider check_and_constantize __callee__ end |
.model_service_provider ⇒ Class
Returns service provider for the mode.
21 22 23 |
# File 'lib/interfaces/wallaby/mode.rb', line 21 def model_service_provider check_and_constantize __callee__ end |