Skip to content

Instantly share code, notes, and snippets.

@BrianJoyce
Created October 18, 2012 04:00
Show Gist options
  • Save BrianJoyce/3909797 to your computer and use it in GitHub Desktop.
Save BrianJoyce/3909797 to your computer and use it in GitHub Desktop.
block fun
class Do_Lotsa_Stuff
def one
save_after { puts "i'm one!"}
end
def two
save_after { puts "i'm two!"}
end
def three
save_after { puts "i'm three!"}
end
def four
save_after { puts "i'm four!" }
end
def save_after(&b)
yield
puts "saving..."
end
end
c = Do_Lotsa_Stuff.new
c.one
c.two
c.one
c.three
c.four
c.two
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment