Sha256: 26562f040f69b20d4be43f620c533079fbc9e79938e469869506a72e41d68d0b
Contents?: true
Size: 841 Bytes
Versions: 1
Compression:
Stored size: 841 Bytes
Contents
# typed: strict # frozen_string_literal: true module Muina class Action class Step < Value # Commands are meant to run code with side effects and return no value. class Command < self def call(action = Object.new) # rubocop:disable Metrics/MethodLength return if action.instance_variable_get(:@__failure__) case result = Muina::Result() { action.instance_eval(&step) } when Muina::Result::Success then success when Muina::Result::Failure then failure(action, result) # :nocov: else T.absurd(result) # :nocov: end end private def success # noop end def failure(action, result) action.instance_variable_set(:@__failure__, result) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
muina-0.2.8 | lib/muina/action/step/command.rb |