るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.021秒)
トップページ > クエリ:ruby[x] > クエリ:yaml/store[x]

別のキーワード

  1. psych to_yaml
  2. yaml/dbm select
  3. yaml/store new
  4. yaml yaml
  5. psych yaml_tag

検索結果

yaml/store (38034.0)

RubyのオブジェクトをYAML形式の外部ファイルに格納するためのクラスです。

...RubyのオブジェクトをYAML形式の外部ファイルに格納するためのクラスです。

例:

require 'yaml/store'

Person = Struct.new :first_name, :last_name

people = [Person.new("Bob", "Smith"), Person.new("Mary", "Johnson")]

store = YAML::Store.new "test.store"

store....
...] = { "hello" => "world" }
end

上記のコードを実行すると "test.store" は以下のようになります。

---
people:
- !ruby/struct:Person
first_name: Bob
last_name: Smith
- !ruby/struct:Person
first_name: Mary
last_name: Johnson
greeting:
hello: world...