class

Avram::Operation

Inherits Avram::Callbacks < Avram::ParamKeyOverride < Avram::OperationErrors < Avram::Validations < Avram::DefineAttribute < Avram::NeedyInitializer < Reference < Object

Constants

ATTRIBUTES = [] of Nil
OPERATION_NEEDS = [] of Nil

Constructors

Class methods

param_key
Source
run(params : Avram::Paramable, *args, **named_args, &)

Yields the instance of the operation, and the return value from the run instance method.

MyOperation.run(params) do |operation, value|
  # operation is complete
end
Source
run(*args, **named_args, &)

Yields the instance of the operation, and the return value from the run instance method.

MyOperation.run do |operation, value|
  # operation is complete
end
Source
run!(params : Avram::Paramable, *args, **named_args)

Returns the value from the run instance method. or raise Avram::FailedOperation if the operation fails.

value = MyOperation.run!(params)
Source
run!(*args, **named_args)

Returns the value from the run instance method. or raise Avram::FailedOperation if the operation fails.

value = MyOperation.run!
Source

Instance methods

after_run(_value)
Source
before_run
Source
custom_errors
params
Source
valid?

Returns true if all attributes are valid, and there's no custom errors

Source

Macros

param_key(key)