#
# To change this template, choose Tools | Templates
# and open the template in the editor.
mystring="aaa"
puts mystring.empty?
class P
def a
yield(ok.empty?)
end
end
class PP
def myclass_b
P.a {|arg|; puts arg}
end
end
class A
def mycool
yield
end
def mycool_yield
A.mycool{puts "OK"}
end
end
The "yield" method is just like the "invoke". But it could do a more little job......
Block,Interator............................
最新推荐文章于 2023-03-08 16:47:33 发布