class Wallaby::Mode
This is the interface that all ORM modes should inherit from and implement.
Public Class Methods
model_decorator()
click to toggle source
@see Wallaby::ModelDecorator
@return [Class] model decorator for the mode
# File lib/interfaces/wallaby/mode.rb, line 9 def model_decorator check_and_constantize __callee__ end
model_finder()
click to toggle source
@see Wallaby::ModelFinder
@return [Class] model finder for the mode
# File lib/interfaces/wallaby/mode.rb, line 15 def model_finder check_and_constantize __callee__ end
model_pagination_provider()
click to toggle source
@see Wallaby::ModelPaginationProvider
@return [Class] pagination provider for the mode @since wallaby-5.2.0
# File lib/interfaces/wallaby/mode.rb, line 28 def model_pagination_provider check_and_constantize __callee__ end
model_service_provider()
click to toggle source
@see Wallaby::ModelServiceProvider
@return [Class] service provider for the mode
# File lib/interfaces/wallaby/mode.rb, line 21 def model_service_provider check_and_constantize __callee__ end
Private Class Methods
check_and_constantize(method_id)
click to toggle source
@return [Class] constantized class
# File lib/interfaces/wallaby/mode.rb, line 57 def check_and_constantize(method_id) method_class = method_id.to_s.classify class_name = "#{name}::#{method_class}" parent_class = "Wallaby::#{method_class}".constantize class_name.constantize.tap do |klass| next if klass < parent_class raise InvalidError, Locale.t('mode.inherit_required', klass: klass, parent: parent_class) end rescue NameError => e Logger.error e raise NotImplemented, class_name end