Skip to content

Instantly share code, notes, and snippets.

@javierav
Created September 4, 2016 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javierav/e311e43897507deacbec4c6f79a481bf to your computer and use it in GitHub Desktop.
Save javierav/e311e43897507deacbec4c6f79a481bf to your computer and use it in GitHub Desktop.
# El atributo manifest se evalua la primera vez que se pide y se cachea su resultado
class A
def manifest
if !@manifest.is_a?(Sprockets::Manifest) && @manifest.respond_to?(:call)
@manifest = @manifest.call
else
@manifest
end
end
attr_writer :manifest
def initialize
@manifest = lambda { Sprockets::Manifest.new(cached, output) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment