Class: Tap::Joins::Sync::Callback
- Inherits:
-
Object
- Object
- Tap::Joins::Sync::Callback
- Defined in:
- lib/tap/joins/sync.rb
Overview
Callbacks are set as the join for each input to a Sync join, and allow the result of an input to be stored in the correct slot of the results array.
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
The results index where result should be stored.
-
#join ⇒ Object
readonly
A backreference to the parent Sync join.
Instance Method Summary collapse
-
#call(result) ⇒ Object
Calls back to a Sync join to store the result at index.
-
#initialize(join, index) ⇒ Callback
constructor
A new instance of Callback.
Constructor Details
#initialize(join, index) ⇒ Callback
Returns a new instance of Callback.
82 83 84 85 |
# File 'lib/tap/joins/sync.rb', line 82 def initialize(join, index) @join = join @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
The results index where result should be stored.
80 81 82 |
# File 'lib/tap/joins/sync.rb', line 80 def index @index end |
#join ⇒ Object (readonly)
A backreference to the parent Sync join.
77 78 79 |
# File 'lib/tap/joins/sync.rb', line 77 def join @join end |
Instance Method Details
#call(result) ⇒ Object
Calls back to a Sync join to store the result at index.
88 89 90 |
# File 'lib/tap/joins/sync.rb', line 88 def call(result) join.call(result, index) end |