Class: Hanami::Extensions::Operation::SliceConfiguredDBOperation Private
- Inherits:
-
Module
- Object
- Module
- Hanami::Extensions::Operation::SliceConfiguredDBOperation
- Defined in:
- lib/hanami/extensions/operation/slice_configured_db_operation.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Extends operations to support the database.
Add an initializer accepting a ‘rom:` dependency, which is supplied automatically from the `“db.rom”` component in the operation’s slice.
Defined Under Namespace
Modules: InstanceMethods Classes: SliceInstanceMethods
Instance Attribute Summary collapse
- #slice ⇒ Object readonly private
Instance Method Summary collapse
- #extended(operation_class) ⇒ Object private
-
#initialize(slice) ⇒ SliceConfiguredDBOperation
constructor
private
A new instance of SliceConfiguredDBOperation.
- #inspect ⇒ Object private
Constructor Details
#initialize(slice) ⇒ SliceConfiguredDBOperation
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.
Returns a new instance of SliceConfiguredDBOperation.
15 16 17 18 |
# File 'lib/hanami/extensions/operation/slice_configured_db_operation.rb', line 15 def initialize(slice) super() @slice = slice end |
Instance Attribute Details
#slice ⇒ Object (readonly)
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.
13 14 15 |
# File 'lib/hanami/extensions/operation/slice_configured_db_operation.rb', line 13 def slice @slice end |
Instance 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.
20 21 22 23 24 25 26 27 |
# File 'lib/hanami/extensions/operation/slice_configured_db_operation.rb', line 20 def extended(operation_class) require "dry/operation/extensions/rom" operation_class.include Dry::Operation::Extensions::ROM operation_class.include InstanceMethods operation_class.include SliceInstanceMethods.new(slice) define_new end |
#inspect ⇒ 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.
29 30 31 |
# File 'lib/hanami/extensions/operation/slice_configured_db_operation.rb', line 29 def inspect "#<#{self.class.name}[#{slice.name}>" end |