k-yamadaのブログ

プログラミングのメモ

gem install what_methods

これ使える
http://d.hatena.ne.jp/CortYuming/20120115/p1

ruby-1.9.2-p290 :014 > {:one => 1}.what? [1]
{:one=>1}.values == [1]
 => [:values]

ruby-1.9.2-p290 :001 > "aa".what? "AA"
"aa".upcase == "AA"
"aa".swapcase == "AA"
"aa".upcase! == "AA"
"aa".swapcase! == "AA"
 => [:upcase, :swapcase, :upcase!, :swapcase!]