Module: Teckel::Operation
- Defined in:
- lib/teckel/operation.rb,
lib/teckel/operation/results.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) see Teckel::Operation::Results
Defined Under Namespace
Modules: ClassMethods, InstanceMethods, Results
Class Method Summary collapse
Class Method Details
.included(receiver) ⇒ Object
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/teckel/operation.rb', line 320 def self.included(receiver) receiver.extend ClassMethods receiver.send :include, InstanceMethods receiver.class_eval do @config = Config.new @input_class = nil @input_constructor = nil @output_class = nil @output_constructor = nil @error_class = nil @error_constructor = nil protected :success!, :fail! end end |