Class: Lazily::Proxy

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/lazily/proxy.rb

Instance Method Summary collapse

Methods included from Enumerable

#[], #chunk, #collect, #compact, #concat, #drop, #drop_while, #flat_map, #flatten, #grep, #in_threads, #lazily, #lazy?, #prefetch, #reject, #select, #slice_before, #take, #take_while, #uniq, #zip

Methods included from Enumerable

#lazily

Constructor Details

#initialize(source) ⇒ Proxy

Returns a new instance of Proxy.



21
22
23
# File 'lib/lazily/proxy.rb', line 21

def initialize(source)
  @source = source
end

Instance Method Details

#each(&block) ⇒ Object



25
26
27
28
# File 'lib/lazily/proxy.rb', line 25

def each(&block)
  return to_enum unless block
  @source.each(&block)
end

#inspectObject



30
31
32
# File 'lib/lazily/proxy.rb', line 30

def inspect
  "#<#{self.class}: #{@source.inspect}>"
end