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.
84 85 86 87 |
# File 'lib/tap/joins/sync.rb', line 84 def initialize(join, index) @join = join @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
The results index where result should be stored.
82 83 84 |
# File 'lib/tap/joins/sync.rb', line 82 def index @index end |
#join ⇒ Object (readonly)
A backreference to the parent Sync join.
79 80 81 |
# File 'lib/tap/joins/sync.rb', line 79 def join @join end |
Instance Method Details
#call(result) ⇒ Object
Calls back to a Sync join to store the result at index.
90 91 92 |
# File 'lib/tap/joins/sync.rb', line 90 def call(result) join.call(result, index) end |