Created
September 4, 2016 22:22
-
-
Save javierav/e311e43897507deacbec4c6f79a481bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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