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
new(params : Avram::Paramable)
Sourcenew
SourceClass methods
param_key
Sourcerun(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
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
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)
run!(*args, **named_args)
Returns the value from the run instance method.
or raise Avram::FailedOperation if the operation fails.
value = MyOperation.run!
Instance methods
after_run(_value)
Sourcebefore_run
Sourcecustom_errors
params
Sourcerun
SourceMacros
param_key(key)