class Chef::Decorator::Lazy

Lazy wrapper to delay construction of an object until a method is called against the object.

@example

  def foo
    puts "allocated"
    "value"
  end

  a = Chef::Decorator::Lazy.new { foo }

  puts "started"
  a
  puts "still lazy"
  puts a

outputs:

  started
  still lazy
  allocated
  value

@since 12.10.x