Class: Rupture::LazySeq
Constant Summary
Constants inherited from Seq
Instance Method Summary collapse
-
#initialize(block = nil) ⇒ LazySeq
constructor
A new instance of LazySeq.
- #seq ⇒ Object
Methods inherited from Seq
Methods included from Sequence
#concat, #conj, #count, #divide, #doall, #drop, #drop_last, #drop_while, #each, #empty?, #every?, #filter, #first, #flatten, #foldr, #frequencies, #into, #last, #map, #map_indexed, #mapcat, #next, #not_empty, #nth, #partition, #partition_all, #partition_between, #partition_by, #reduce, #reductions, #remove, #rest, #reverse, #second, #separate, #sequential?, #some, #sort, #sort_by, #split_at, #split_with, #take, #take_last, #take_while, #tree_seq
Constructor Details
#initialize(block = nil) ⇒ LazySeq
Returns a new instance of LazySeq.
5 6 7 |
# File 'lib/rupture/lazy_seq.rb', line 5 def initialize(block = nil) @block = block end |
Instance Method Details
#seq ⇒ Object
9 10 11 12 13 14 |
# File 'lib/rupture/lazy_seq.rb', line 9 def seq return @seq unless @block @seq = @block.call.seq @block = nil @seq end |