Sha256: bbd4f9fe821b4ce1a271d1706f57edbf2c0f220f8eac60d6525d99cb27fe6fe4
Contents?: true
Size: 679 Bytes
Versions: 18
Compression:
Stored size: 679 Bytes
Contents
# frozen_string_literal: true require "much-rails/action/base_result" module MuchRails; end module MuchRails::Action; end # MuchRails::Action::BaseCommandResult is a base result that, when # executed, runs a generic controller command with some given args. class MuchRails::Action::BaseCommandResult < MuchRails::Action::BaseResult attr_reader :command_name, :command_args def initialize(command_name, *command_args) @command_name = command_name @command_args = command_args end # This block is called using `instance_exec` in the scope of the controller def execute_block ->(result){ public_send(result.command_name, *result.command_args) } end end
Version data entries
18 entries across 18 versions & 1 rubygems