module Sprockets
  class LazyProxy
    def initialize(&block)
      @block = block
      @proc  = nil
    end

    def call(*args)
      @proc ||= @block.call
      @proc.call(*args)
    end
  end
end

require 'delegate'

module Sprockets
  # Internal: Used for lazy loading processors.
  #
  #   LazyProxy.new { CoffeeScriptTemplate }
  #
  class LazyProxy < Delegator
    def initialize(&block)
      @_block = block
    end

    def __getobj__
      @_obj ||= @_block.call
    end
  end
end

Use delegator for lazy proxy
Use delegator for lazy proxy
