Module: Wallaby::Servicable

Included in:
ResourcesConcern, ResourcesHelper
Defined in:
lib/concerns/wallaby/servicable.rb

Overview

Servicer related attributes

Instance Method Summary collapse

Instance Method Details

#current_servicerModelServicer

Model servicer for current modal class.

Returns:

See Also:

Since:

  • wallaby-5.2.0



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/concerns/wallaby/servicable.rb', line 10

def current_servicer
  @current_servicer ||=
    ServicerFinder.new(
      script_name: script_name,
      model_class: current_model_class,
      current_controller_class: wallaby_controller
    ).execute.try do |klass|
      Logger.debug %(Current servicer: #{klass}), sourcing: false
      klass.new current_model_class, current_authorizer, current_model_decorator
    end
end