Module: Hanami::Extensions::Operation

Defined in:
lib/hanami/extensions/operation.rb,
lib/hanami/extensions/operation/slice_configured_db_operation.rb

Overview

Integrated behavior for ‘Dry::Operation` classes within Hanami apps.

Defined Under Namespace

Classes: SliceConfiguredDBOperation

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(operation_class) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



17
18
19
20
21
# File 'lib/hanami/extensions/operation.rb', line 17

def self.extended(operation_class)
  super

  operation_class.extend(Hanami::SliceConfigurable)
end

Instance Method Details

#configure_for_slice(slice) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.2.0



26
27
28
# File 'lib/hanami/extensions/operation.rb', line 26

def configure_for_slice(slice)
  extend SliceConfiguredDBOperation.new(slice) if Hanami.bundled?("hanami-db")
end