返回顶部

收藏

A block is a section of code that can be passed to a method much like passing an argument.

更多
A block is delimited with {}:

{ puts 'Hello there!' }

or do and end:

do
  puts 'Hello there!'
end

# Generally, you use {} for a one-line block, and do..end for a multi-line block. 

标签:Ruby,Method

收藏

0人收藏

支持

0

反对

0

发表评论