るりまサーチ

最速Rubyリファレンスマニュアル検索!
1804件ヒット [1801-1804件を表示] (0.400秒)
トップページ > クエリ:Kernel.#p[x] > クエリ:cpp_command[x] > クエリ:namespace[x] > クエリ:$10[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

<< < ... 17 18 19 >>

Object#to_str -> String (13.0)

オブジェクトの String への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...面で代置可能であるような、
* 文字列そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_str
'Edition'
end
end

it = Foo.new
p
('Second' + it) #=> "SecondEdition"
//}

@see Object#to_s,Kernel.#String...
<< < ... 17 18 19 >>