るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.096秒)
トップページ > クエリ:Kernel.#sprintf[x] > クエリ:ruby 1.6 feature[x] > バージョン:2.2.0[x] > クエリ:to_i[x] > クエリ:log[x] > クラス:Object[x]

別のキーワード

  1. argf.class lines
  2. argf.class each_line
  3. argf.class each
  4. asn1 printablestring
  5. asn1 utf8string

ライブラリ

検索結果

Object#to_s -> String (76.0)

オブジェクトの文字列表現を返します。

...使って文字列に変換し
ます。

//emlist[][ruby]{
class Foo
def initialize num
@num = num
end
end
it = Foo.new(40)

puts it #=> #<Foo:0x2b69110>

class Foo
def to_s
"Class:Foo Number:#{@num}"
end
end

puts it #=> Class:Foo Number:40
//}

@see Object#to_str,Kernel.#String...