class Bud::PushEachWithIndex
Public Class Methods
new(elem_name, bud_instance, collection_name)
click to toggle source
Calls superclass method
Bud::PushElement::new
# File lib/bud/executor/elements.rb, line 539 def initialize(elem_name, bud_instance, collection_name) super(elem_name, bud_instance, collection_name) @each_index = 0 end
Public Instance Methods
add_rescan_invalidate(rescan, invalidate)
click to toggle source
Calls superclass method
Bud::PushStatefulElement#add_rescan_invalidate
# File lib/bud/executor/elements.rb, line 544 def add_rescan_invalidate(rescan, invalidate) super # This node has some state (@each_index), but not the tuples. If it is in # rescan mode, then it must ask its sources to rescan, and restart its # index. if rescan.member? self invalidate << self srcs = non_temporal_predecessors rescan.merge(srcs) end end
insert(item, source=nil)
click to toggle source
# File lib/bud/executor/elements.rb, line 565 def insert(item, source=nil) ix = @each_index @each_index += 1 push_out([item, ix]) end
invalidate_cache()
click to toggle source
# File lib/bud/executor/elements.rb, line 557 def invalidate_cache @each_index = 0 end
stratum_end()
click to toggle source
# File lib/bud/executor/elements.rb, line 561 def stratum_end @each_index = 0 end