标签:
#!/usr/local/bin/ruby -w # # # def call_each animals = %w{ant bee cat dog elk} for animal in animals yield animal end end call_each {|animal_block| puts animal_block}
ruby block each
原文地址:http://my.oschina.net/7shell/blog/380459