Class: Ori::LazyEnumerable

Inherits:
Lazy
  • Object
show all
Defined in:
lib/ori/lazy.rb

Direct Known Subclasses

LazyArray, LazyHash, LazyHashSet

Instance Method Summary collapse

Methods inherited from Lazy

#initialize, #initialized?, #internal

Constructor Details

This class inherits a constructor from Ori::Lazy

Instance Method Details

#any?(&block) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
35
36
# File 'lib/ori/lazy.rb', line 32

def any?(&block)
  return false unless initialized?

  internal.any?(&block)
end

#delete_if(&block) ⇒ Object



26
27
28
29
30
# File 'lib/ori/lazy.rb', line 26

def delete_if(&block)
  return self unless initialized?

  internal.delete_if(&block)
end

#each(&block) ⇒ Object



19
20
21
22
23
24
# File 'lib/ori/lazy.rb', line 19

def each(&block)
  return enum_for(:each) unless block_given?
  return self unless initialized?

  internal.each(&block)
end

#empty?Boolean

Returns:

  • (Boolean)


38
39
40
41
42
# File 'lib/ori/lazy.rb', line 38

def empty?
  return true unless initialized?

  internal.empty?
end