Class: Stream::EmptyStream

Inherits:
Stream
  • Object
show all
Defined in:
lib/ruby-stream.rb

Instance Attribute Summary

Attributes inherited from Stream

#head

Instance Method Summary collapse

Methods inherited from Stream

continually, #last, #length, #scan

Constructor Details

#initializeEmptyStream

Returns a new instance of EmptyStream.



104
105
106
# File 'lib/ruby-stream.rb', line 104

def initialize()
  @head = nil
end

Instance Method Details

#[](n) ⇒ Object



112
113
114
# File 'lib/ruby-stream.rb', line 112

def [](n)
  nil
end

#eachObject



116
117
118
# File 'lib/ruby-stream.rb', line 116

def each
  nil
end

#filter(&block) ⇒ Object



132
133
134
# File 'lib/ruby-stream.rb', line 132

def filter(&block)
  EmptyStream.new
end

#map(&block) ⇒ Object



128
129
130
# File 'lib/ruby-stream.rb', line 128

def map(&block)
  EmptyStream.new
end

#tailObject



108
109
110
# File 'lib/ruby-stream.rb', line 108

def tail
  EmptyStream.new
end

#take(n) ⇒ Object



120
121
122
# File 'lib/ruby-stream.rb', line 120

def take(n)
  EmptyStream.new
end

#take_while(&block) ⇒ Object



124
125
126
# File 'lib/ruby-stream.rb', line 124

def take_while(&block)
  EmptyStream.new
end