Skip to content

Instantly share code, notes, and snippets.

@cwgem
Created July 27, 2011 15:39
Show Gist options
  • Save cwgem/1109638 to your computer and use it in GitHub Desktop.
Save cwgem/1109638 to your computer and use it in GitHub Desktop.
ブロック引数の取り込み
def my_block_method
if block_given?
(["hello"] * 3).each { | x |
yield x
}
end
end
my_block_method { | x |
puts x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment