haiyang 发表于 2013-2-4 22:52:14

programming ruby 之第7,8章学习总结

1.基本上所有的东西在ruby里边都是表达式
One of the first differenceswith Ruby is that anything that can reasonably return a value does: just about everything is an expression.What does this mean in practice?
Some obvious things include the ability to chain statements together.
 
<div class="dp-highlighter"><div class="bar" />   
[*]handle = if song.artist == "Gillespie" then     
[*]<span />"Dizzy"     
[*]<span />elsif song.artist == "Parker" then     
[*]<span />"Bird"     
[*]<span />else     
[*]<span />"unknown"     
[*]<span />end  
页: [1]
查看完整版本: programming ruby 之第7,8章学习总结