Module: Teckel::Operation
- Defined in:
- lib/teckel/operation.rb,
lib/teckel/operation/config.rb,
lib/teckel/operation/result.rb,
lib/teckel/operation/runner.rb
Overview
The main operation Mixin
Each operation is expected to declare input. output and error classes.
There are two ways of declaring those classes. The first way is to define the constants Input, Output and Error, the second way is to use the input. output and error methods to point them to anonymous classes.
If you like “traditional” result objects to ask successful? or failure? on, use result! and get Result
By default, input. output and error classes are build using :[] (eg: Input[some: :param]).
Use input_constructor, output_constructor and error_constructor to change them.
Defined Under Namespace
Modules: ClassMethods, Config, InstanceMethods, ValueResult Classes: Result, Runner
Class Method Summary collapse
Class Method Details
.included(receiver) ⇒ Object
179 180 181 182 183 |
# File 'lib/teckel/operation.rb', line 179 def self.included(receiver) receiver.extend Config receiver.extend ClassMethods receiver.send :include, InstanceMethods end |