Class: Lab42::Stream::Empty
Constant Summary
ConstraintError, EmptyStream, IllegalState, Version
Instance Attribute Summary
#promise
Class Method Summary
collapse
Instance Method Summary
collapse
#__combine_streams__, #combine_streams, #drop, #to_stream
#iterate
#__combine__, #combine, #split_into
Methods included from Enumerable
#__drop_while__, #__filter__, #__flatmap__, #__flatmap_with_each__, #__inject_while__, #__lazy_take__, #__lazy_take_until__, #__lazy_take_while__, #__map__, #__scan__, #__take_while__, #__zip__, #drop_until, #drop_while, #each, #each_without_loops, #filter, #flatmap, #flatmap_with_each, #force_all, #lazy_take, #lazy_take_until, #lazy_take_while, #make_cyclic, #map, #reduce, #reduce_while, #reject, #take, #take_until, #take_while, #to_a, #zip, #zip_as_ary
Methods included from Utility
#__segment__, #segment, #with_index
Class Method Details
.new ⇒ Object
47
48
49
|
# File 'lib/lab42/stream/empty.rb', line 47
def self.new
@__instance__ ||= allocate
end
|
Instance Method Details
#append(other) ⇒ Object
Also known as:
+
19
20
21
22
23
|
# File 'lib/lab42/stream/empty.rb', line 19
def append other
raise ArgumentError, "not a stream #{other}" unless self.class.superclass === other
other.to_stream
end
|
#empty? ⇒ Boolean
26
|
# File 'lib/lab42/stream/empty.rb', line 26
def empty?; true end
|
#head ⇒ Object
29
|
# File 'lib/lab42/stream/empty.rb', line 29
def head; raise StopIteration, "head called on empty stream" end
|
#inject(*args) ⇒ Object
Also known as:
__inject__
33
|
# File 'lib/lab42/stream/empty.rb', line 33
def inject *args; args.first end
|
#itself ⇒ Object
36
|
# File 'lib/lab42/stream/empty.rb', line 36
def itself *; self end
|
#scan(initial) ⇒ Object
38
39
40
|
# File 'lib/lab42/stream/empty.rb', line 38
def scan( initial, * )
[initial]
end
|
#scan1 ⇒ Object
42
43
44
|
# File 'lib/lab42/stream/empty.rb', line 42
def scan1( * )
[]
end
|
#tail ⇒ Object
30
|
# File 'lib/lab42/stream/empty.rb', line 30
def tail; raise StopIteration, "tail called on empty stream" end
|