mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/pstore] Enhanced RDoc
https://github.com/ruby/pstore/commit/7e56730689
This commit is contained in:
parent
d7419354ac
commit
7e8fd40c06
1 changed files with 13 additions and 12 deletions
|
@ -44,25 +44,26 @@ require "digest"
|
||||||
# # Example code using store goes here.
|
# # Example code using store goes here.
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# The implementation of +example_store+
|
# All we really need to know about +example_store+
|
||||||
# (which is profoundly unimportant here):
|
# is that it yields a fresh store with a known population of roots;
|
||||||
|
# its implementation:
|
||||||
#
|
#
|
||||||
# require 'pstore'
|
# require 'pstore'
|
||||||
# require 'tempfile'
|
# require 'tempfile'
|
||||||
# # Yield a pristine store for use in examples.
|
# # Yield a pristine store for use in examples.
|
||||||
# def example_store
|
# def example_store
|
||||||
# # Create the store in a temporary file.
|
# # Create the store in a temporary file.
|
||||||
# Tempfile.create do |file|
|
# Tempfile.create do |file|
|
||||||
# store = PStore.new(file)
|
# store = PStore.new(file)
|
||||||
# # Populate the store.
|
# # Populate the store.
|
||||||
# store.transaction do
|
# store.transaction do
|
||||||
# store[:foo] = 0
|
# store[:foo] = 0
|
||||||
# store[:bar] = 1
|
# store[:bar] = 1
|
||||||
# store[:baz] = 2
|
# store[:baz] = 2
|
||||||
|
# end
|
||||||
|
# yield store
|
||||||
# end
|
# end
|
||||||
# yield store
|
|
||||||
# end
|
# end
|
||||||
# end
|
|
||||||
#
|
#
|
||||||
# == The Store
|
# == The Store
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue