2013-01-06から1日間の記事一覧

Rubyの==演算子を再定義する(ネタ)

こんなツイートをみかけた 実はRubyだとこれができてしまう # coding: utf-8 class String alias_method :eql, :== def ==(other) return true if self.eql("おっぱい") && other.eql("えりっく") eql(other) end end puts "おっぱい" == "えりっく" # => tr…