Module: Dry::Effects::Constructors

Defined in:
lib/dry/effects/constructors.rb

Instance Method Summary collapse

Instance Method Details

#CurrentTime(**kwargs) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/dry/effects/constructors.rb', line 7

def CurrentTime(**kwargs)
  if kwargs.empty?
    Effects::CurrentTime::CurrentTime
  else
    Effects::CurrentTime::CurrentTime.(**kwargs)
  end
end

#Read(scope) ⇒ Object



26
27
28
# File 'lib/dry/effects/constructors.rb', line 26

def Read(scope)
  Effects::State::State.new(type: :state, name: :read, scope: scope)
end

#Resolve(identifier) ⇒ Object



16
17
18
# File 'lib/dry/effects/constructors.rb', line 16

def Resolve(identifier)
  Effects::Resolve::Resolve.(identifier)
end

#Retry(scope) ⇒ Object



21
22
23
# File 'lib/dry/effects/constructors.rb', line 21

def Retry(scope)
  Effects::Retry::Retry.new(type: :retry, scope: scope)
end

#Write(scope, value) ⇒ Object



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

def Write(scope, value)
  Effects::State::State.new(type: :state, name: :write, scope: scope, payload: [value])
end