Class: Startback::Operation::MultiOperation
- Inherits:
-
Startback::Operation
- Object
- Startback::Operation
- Startback::Operation::MultiOperation
- Defined in:
- lib/startback/operation/multi_operation.rb
Instance Attribute Summary collapse
-
#ops ⇒ Object
readonly
Returns the value of attribute ops.
Attributes inherited from Startback::Operation
Instance Method Summary collapse
- #+(other) ⇒ Object
- #bind(world) ⇒ Object
- #call ⇒ Object
-
#initialize(ops = []) ⇒ MultiOperation
constructor
A new instance of MultiOperation.
- #size ⇒ Object
Methods inherited from Startback::Operation
emits, #method_missing, #respond_to?, #with_context
Methods included from Support::TransactionPolicy
#after_commit, #transaction_policy, #transaction_policy=
Methods included from Support::OperationRunner
Methods included from Errors
bad_request_error!, conflict_error!, expectation_failed_error!, forbidden_error!, gone_error!, internal_server_error!, locked_error!, method_not_allowed_error!, not_acceptable_error!, not_found_error!, not_implemented_error!, precondition_failed_error!, precondition_required_error!, server_error!, unauthorized_error!, unsupported_media_type_error!, user_error!
Constructor Details
#initialize(ops = []) ⇒ MultiOperation
Returns a new instance of MultiOperation.
5 6 7 |
# File 'lib/startback/operation/multi_operation.rb', line 5 def initialize(ops = []) @ops = ops end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Startback::Operation
Instance Attribute Details
#ops ⇒ Object (readonly)
Returns the value of attribute ops.
8 9 10 |
# File 'lib/startback/operation/multi_operation.rb', line 8 def ops @ops end |
Instance Method Details
#+(other) ⇒ Object
14 15 16 |
# File 'lib/startback/operation/multi_operation.rb', line 14 def +(other) MultiOperation.new(@ops + Array(other)) end |
#bind(world) ⇒ Object
18 19 20 |
# File 'lib/startback/operation/multi_operation.rb', line 18 def bind(world) MultiOperation.new(ops.map{|op| op.bind(world) }) end |
#call ⇒ Object
22 23 24 |
# File 'lib/startback/operation/multi_operation.rb', line 22 def call ops.map{|op| op.call } end |
#size ⇒ Object
10 11 12 |
# File 'lib/startback/operation/multi_operation.rb', line 10 def size ops.size end |