2008年5月3日 星期六

method naming ( end with ? or ! )

method that returns true or false ends with ?

ex: 

empty?


method that changes the state of the object ends with!

ex: 

save!


built-in methods with !

upcase!,  chomp!,  sort!,  reverse!


沒有留言: