Skip to content

Instantly share code, notes, and snippets.

@joshuamiller
Created July 20, 2010 01:22
Show Gist options
  • Save joshuamiller/482307 to your computer and use it in GitHub Desktop.
Save joshuamiller/482307 to your computer and use it in GitHub Desktop.
class Tester
attr_accessor :name, :age
def testy (&block)
instance_eval &block
end
end
name = "Josh"
t = Tester.new
t.name = "Larry"
t.age = 10
t.testy { puts [name, age] }
#=> Josh
#=> 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment