class Redress::Command

Public Class Methods

call(*args, &block) click to toggle source
# File lib/redress/command.rb, line 11
def self.call(*args, &block)
  result = new(*args).call
  return result unless block_given?

  Dry::Matcher::ResultMatcher.call(result, &block)
end
run(*args, &block) click to toggle source
# File lib/redress/command.rb, line 18
def self.run(*args, &block)
  command = new(*args)
  result = command.call
  return command unless block_given?

  Dry::Matcher::ResultMatcher.call(result, &block)

  command
end

Public Instance Methods

call() click to toggle source
# File lib/redress/command.rb, line 28
def call
  raise NotImplementedError
end