るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

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

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

... Ruby のオブジェクトに
変換したりその逆をしたりすることができます。

@param tag 対象のクラスに関連付けるタグの文字列

=== Example
require 'psych'

class Foo
def initialize(x)
@x = x
end

attr_reader :x
end

# Dumps Ruby...
...w(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,2013:foo>
# x: 3

# Loads the object from the tagged YAML n...

Object.new -> Object (8.0)

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

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

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