Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 9, 2012 23:06
Show Gist options
  • Save cheald/4048912 to your computer and use it in GitHub Desktop.
Save cheald/4048912 to your computer and use it in GitHub Desktop.
class Foo
@start = Time.now.to_i
def self.start
@start
end
def make_another_class
Class.new do
@start = Time.now.to_i
def self.start
@start
end
end
end
end
f = Foo.new
puts "F's start was defined at #{Foo.start}"
sleep(2)
c = f.make_another_class
puts "C's start was defined at #{c.start}"
F's start was defined at 1352502381
C's start was defined at 1352502383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment