# !/usr/bin/ruby -w # -*- encoding:utf-8 -*- # filename: main.rb # author: 简单教程(www.twle.cn) # Copyright © 2015-2065 www.twle.cn. All rights reserved. def hello puts "在 hello 方法内" yield puts "你又回到了 hello 方法内" yield end hello{ puts "你在语句块(block) 内" }