るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.037秒)
トップページ > クエリ:time[x] > ライブラリ:ビルトイン[x] > クエリ:-[x] > クエリ:inspect[x] > クラス:Object[x]

別のキーワード

  1. time iso8601
  2. time httpdate
  3. time rfc2822
  4. time parse
  5. time strptime

検索結果

Object#inspect -> String (18252.0)

オブジェクトを人間が読める形式に変換した文字列を返します。

...して
オブジェクトを表示します。

//emlist[][ruby]{
[ 1, 2, 3..4, 'five' ].inspect # => "[1, 2, 3..4, \"five\"]"
Time
.new.inspect # => "2008-03-08 19:43:39 +0900"
//}

inspect
メソッドをオーバーライドしなかった場合、クラス名とインスタン...
...変数の名前、値の組を元にした文字列を返します。

//emlist[][ruby]{
class Foo
end
Foo.new.inspect # => "#<Foo:0x0300c868>"

class Bar
def initialize
@bar = 1
end
end
Bar.new.inspect # => "#<Bar:0x0300c868 @bar=1>"
//}

@see Kernel.#p...