Class: Dry::Effects::Provider Private
- Inherits:
-
Object
- Object
- Dry::Effects::Provider
- Extended by:
- Initializer, ClassInterface
- Defined in:
- lib/dry/effects/provider.rb,
lib/dry/effects/provider/class_interface.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.
Base class for effect providers
Defined Under Namespace
Modules: ClassInterface
Instance Attribute Summary
Attributes included from ClassInterface
Instance Method Summary collapse
-
#call ⇒ Object
private
yield the block with the handler installed.
- #inspect ⇒ String
-
#provide?(effect) ⇒ Boolean
Whether the effect can be handled?.
-
#represent ⇒ String
Effect-specific representation of the provider.
-
#type ⇒ Symbol
Effect type.
Methods included from Initializer
Methods included from ClassInterface
[], extended, handle_method, mixin
Instance Method Details
#call ⇒ 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.
yield the block with the handler installed
15 16 17 |
# File 'lib/dry/effects/provider.rb', line 15 def call yield end |
#inspect ⇒ String
46 47 48 |
# File 'lib/dry/effects/provider.rb', line 46 def inspect "#<#{self.class.name} #{represent}>" end |
#provide?(effect) ⇒ Boolean
Whether the effect can be handled?
40 41 42 |
# File 'lib/dry/effects/provider.rb', line 40 def provide?(effect) type.equal?(effect.type) end |
#represent ⇒ String
Effect-specific representation of the provider
23 24 25 |
# File 'lib/dry/effects/provider.rb', line 23 def represent type.to_s end |
#type ⇒ Symbol
Effect type
31 32 33 |
# File 'lib/dry/effects/provider.rb', line 31 def type self.class.type end |