lib/dry/effects/effects/timeout.rb in dry-effects-0.1.5 vs lib/dry/effects/effects/timeout.rb in dry-effects-0.2.0
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-require 'dry/effects/effect'
+require "dry/effects/effect"
module Dry
module Effects
module Effects
class Timeout < ::Module
@@ -11,9 +11,11 @@
option :scope
end
def initialize(scope)
+ super()
+
timeout = TimeoutEffect.new(type: :timeout, name: :timeout, scope: scope)
module_eval do
define_method(:timeout) do
::Dry::Effects.yield(timeout)