Class: TypedOperation::ChainedOperation

Inherits:
Object
  • Object
show all
Includes:
Operations::Composition
Defined in:
lib/typed_operation/chains/chained_operation.rb

Overview

Base class for operation chains.

Values flow through chains as-is - no implicit splatting. If you need to convert a value to kwargs for the next operation, use .then_passes { |v| NextOp.call(**v) } or .transform to reshape first.

Instance Method Summary collapse

Methods included from Operations::Composition

#or_else, #then, #then_passes, #then_spreads, #transform

Constructor Details

#initialize(left, right) ⇒ ChainedOperation

: (_Callable, _Callable) -> void



17
18
19
20
# File 'lib/typed_operation/chains/chained_operation.rb', line 17

def initialize(left, right)
  @left = left
  @right = right
end

Instance Method Details

#callObject

: (*untyped, **untyped) -> _Result[untyped, untyped]

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/typed_operation/chains/chained_operation.rb', line 23

def call(...)
  raise NotImplementedError, "Subclasses must implement #call"
end