Class: Transflow::Publisher::Monadic

Inherits:
Transflow::Publisher show all
Defined in:
lib/transflow/publisher.rb

Instance Attribute Summary

Attributes inherited from Transflow::Publisher

#name, #op

Instance Method Summary collapse

Methods inherited from Transflow::Publisher

[], #arity, #curry, #initialize, #subscribe

Constructor Details

This class inherits a constructor from Transflow::Publisher

Instance Method Details

#call(*args) ⇒ Object



25
26
27
28
29
# File 'lib/transflow/publisher.rb', line 25

def call(*args)
  op.(*args)
    .or { |result| broadcast_failure(*args, result) and Left(result) }
    .>-> value { broadcast_success(value) and Right(value) }
end