Class: Transflow::Publisher
- Inherits:
-
Object
- Object
- Transflow::Publisher
- Includes:
- Wisper::Publisher
- Defined in:
- lib/transflow/publisher.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
Instance Method Summary collapse
- #call(*args) ⇒ Object (also: #[])
-
#initialize(name, op) ⇒ Publisher
constructor
A new instance of Publisher.
Constructor Details
#initialize(name, op) ⇒ Publisher
Returns a new instance of Publisher.
11 12 13 14 |
# File 'lib/transflow/publisher.rb', line 11 def initialize(name, op) @name = name @op = op end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/transflow/publisher.rb', line 7 def name @name end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
9 10 11 |
# File 'lib/transflow/publisher.rb', line 9 def op @op end |
Instance Method Details
#call(*args) ⇒ Object Also known as: []
16 17 18 19 20 21 22 23 |
# File 'lib/transflow/publisher.rb', line 16 def call(*args) result = op.call(*args) broadcast(:"#{name}_success", result) result rescue => err broadcast(:"#{name}_failure", *args, err) raise err end |