るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.039秒)
トップページ > バージョン:2.5.0[x] > クエリ:y[x] > クエリ:of[x] > クエリ:yaml_tag[x]

別のキーワード

  1. fileutils options_of
  2. _builtin of
  3. objspace memsize_of
  4. objspace memsize_of_all
  5. rake kind_of?

ライブラリ

クラス

検索結果

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

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

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

これによって tag 付けされた YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。

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

=== Example
require 'psych'

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

attr_reader :x
end

# Dumps Ruby object normally
p Psych.dump(Foo.new(3))
...