Class: Lab42::Stream::Empty
Constant Summary
ConstraintError, Version
Instance Attribute Summary
#promise
Instance Method Summary
collapse
#__inject_while__, #drop, #each, #filter_by_proc, #reduce_while, #to_stream, #transform_by_proc
Methods included from Enumerable
#to_stream
Instance Method Details
#__flatmap__(a_proc) ⇒ Object
27
|
# File 'lib/lab42/stream/empty.rb', line 27
def __flatmap__ a_proc; self end
|
#append(other) ⇒ Object
Also known as:
+
TODO: Implement all self returning methods with Forwarder
5
6
7
8
9
|
# File 'lib/lab42/stream/empty.rb', line 5
def append other
raise ArgumentError, "not a stream #{other}" unless self.class.superclass === other
other.to_stream
end
|
#empty? ⇒ Boolean
12
|
# File 'lib/lab42/stream/empty.rb', line 12
def empty?; true end
|
#filter(*args, &blk) ⇒ Object
14
|
# File 'lib/lab42/stream/empty.rb', line 14
def filter *args, &blk; self end
|
#flatmap(*args, &blk) ⇒ Object
26
|
# File 'lib/lab42/stream/empty.rb', line 26
def flatmap *args, &blk; self end
|
#head ⇒ Object
16
|
# File 'lib/lab42/stream/empty.rb', line 16
def head; raise StopIteration, "head called on empty stream" end
|
#make_cyclic ⇒ Object
18
|
# File 'lib/lab42/stream/empty.rb', line 18
def make_cyclic; self end
|
#map(*args, &blk) ⇒ Object
19
|
# File 'lib/lab42/stream/empty.rb', line 19
def map *args, &blk; self end
|
#tail ⇒ Object
I believe that this definition is sound, although it is an obvious pitfall But falling into it once, means understanding streams better, well that is my opinion now, we will see what promises the future will bring…
23
|
# File 'lib/lab42/stream/empty.rb', line 23
def tail; self end
|