Techioz Blog

Ruby - Python str() メソッドと同等?

概要

Ruby では、Python クラスで定義できる str() メソッドと同等のものはありますか?

解決策

to_s を使用できます。

http://briancarper.net/2006/09/26/ruby-to_s-vs-to_str/