るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.023秒)
トップページ > クラス:Object[x] > クエリ:Time[x] > クエリ:inspect[x] > 種類:インスタンスメソッド[x]

別のキーワード

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

ライブラリ

検索結果

Object#inspect -> String (18139.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...