るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

クラス

検索結果

Object.yaml_tag(tag) -> () (78412.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))
...