るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

Object.new -> Object (102.0)

Objectクラスのインスタンスを生成して返します。

...
Object
クラスのインスタンスを生成して返します。

//emlist[][ruby]{
some = Object.new
p some #=> #<Object:0x2b696d8>
//}...

Object.yaml_tag(tag) -> () (102.0)

クラスと tag の間を関連付けます。

...end

# Dumps Ruby object normally
p Psych.dump(Foo.new(3))
# =>
# --- !ruby/object:Foo
# x: 3

# Registers tag with class Foo
Foo.yaml_as("tag:example.com,2013:foo")
# ... and dumps the object of Foo class
Psych.dump(Foo.new(3), STDOUT)
# =>
# --- !<tag:example.com,201...
...3:foo>
# x: 3

# Loads the object from the tagged YAML node
p Psych.load(<<EOS)
-
-- !<tag:example.com,2012:foo>
x: 8
EOS
# => #<Foo:0x0000000130f48 @x=8>...