Class: Dry::Effects::Provider Private

Inherits:
Object
  • Object
show all
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

#effects

Instance Method Summary collapse

Methods included from Initializer

extended

Methods included from ClassInterface

[], extended, handle_method, mixin

Instance Method Details

#callObject

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

#inspectString

Returns:

  • (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?

Parameters:

Returns:

  • (Boolean)


40
41
42
# File 'lib/dry/effects/provider.rb', line 40

def provide?(effect)
  type.equal?(effect.type)
end

#representString

Effect-specific representation of the provider

Returns:

  • (String)


23
24
25
# File 'lib/dry/effects/provider.rb', line 23

def represent
  type.to_s
end

#typeSymbol

Effect type

Returns:

  • (Symbol)


31
32
33
# File 'lib/dry/effects/provider.rb', line 31

def type
  self.class.type
end