11件ヒット
[1-11件を表示]
(0.025秒)
検索結果
先頭1件
-
yaml
/ store (38048.0) -
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.transaction do
store["people"] = people
st......] = { "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...