Skip to content

Instantly share code, notes, and snippets.

View alexmacedo's full-sized avatar

Alexandre Macedo alexmacedo

  • Delivery Direto
  • São Paulo, Brazil
View GitHub Profile
@alexmacedo
alexmacedo / lazy.rb
Created November 27, 2010 14:40
lazy proc implementation in ruby
module Lazy
class LazyProc
alias __class__ class
instance_methods.each { |m| undef_method m unless m =~ /^__/ or m == :object_id }
def initialize(&computation)
@computation = computation
end
def inspect