26. ブロックをcallする
class Robot
attr :name, :route
def initialize(name)
@name=name
@route={}
end
def 時(time, &b)
b.call(time)
end
end
def 掃除する(room)
puts "#{room}掃除終わったなっしー"
end
def ロボットの名前(name)
define_method(name) {Robot.new(name)}
end
るん太.時 14 do 掃除する "リビング" end