Class: Pacer::Core::Route::DetachedPipe

Inherits:
Object
  • Object
show all
Defined in:
lib/pacer/core/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expando, pipe, collection) ⇒ DetachedPipe

Returns a new instance of DetachedPipe.



679
680
681
682
683
# File 'lib/pacer/core/route.rb', line 679

def initialize(expando, pipe, collection)
  @expando = expando
  @pipe = pipe
  @collection = collection
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



677
678
679
# File 'lib/pacer/core/route.rb', line 677

def collection
  @collection
end

#expandoObject (readonly)

Returns the value of attribute expando.



677
678
679
# File 'lib/pacer/core/route.rb', line 677

def expando
  @expando
end

#pipeObject (readonly)

Returns the value of attribute pipe.



677
678
679
# File 'lib/pacer/core/route.rb', line 677

def pipe
  @pipe
end

Instance Method Details

#read(element) ⇒ Object



685
686
687
688
689
690
691
692
693
# File 'lib/pacer/core/route.rb', line 685

def read(element)
  pipe.reset unless collection
  expando.add element
  if pipe.hasNext
    pipe.next
  elsif collection
    []
  end
end