るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. psych load_stream
  2. psych safe_load
  3. irb/cmd/load execute
  4. json load
  5. psych load

ライブラリ

クラス

検索結果

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