Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created December 4, 2010 01:43
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 evanphx/727823 to your computer and use it in GitHub Desktop.
Save evanphx/727823 to your computer and use it in GitHub Desktop.
class Bar
class MyScope
attr_accessor :x
end
cm = dynamic_method :foo do |g|
g.push_literal Time.now.to_s
g.ret
end
puts cm.decode
end
p Bar.new.foo
sleep 5
p Bar.new.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment