Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 23, 2012 08:57
Show Gist options
  • Select an option

  • Save cheald/4134622 to your computer and use it in GitHub Desktop.

Select an option

Save cheald/4134622 to your computer and use it in GitHub Desktop.
def let(name, &block)
define_method(name) do
__memoized.fetch(name) {|k| __memoized[k] = instance_eval(&block) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment