Skip to content

Instantly share code, notes, and snippets.

@aquarla
Created October 4, 2010 10:24
Show Gist options
  • Save aquarla/609484 to your computer and use it in GitHub Desktop.
Save aquarla/609484 to your computer and use it in GitHub Desktop.
a simple example of Ruby "yield"
def transaction
begin
# tx.begin
yield
# tx.commit
rescue
# tx.rollback
end
end
transaction do
# 処理
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment