diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-12 03:49:50 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-12 03:49:50 +0000 |
commit | 8a896179ada36b4fc0f50d75500c801a3097924a (patch) | |
tree | ded6eab81717f8c20770e5021e63f18e962fec87 /lib | |
parent | 4852e7e6737713f4bc984796ee14593641a85587 (diff) | |
download | ruby-8a896179ada36b4fc0f50d75500c801a3097924a.tar.gz |
* lib/yaml.rb, lib/yaml/: [DOC] Document YAML::DBM#key and add
references to similar methods with more detail. This patch brings
lib/yaml to 100% documentation coverage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yaml.rb | 2 | ||||
-rw-r--r-- | lib/yaml/dbm.rb | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index 2d411f2ff7..f9f8e6d665 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -10,7 +10,7 @@ rescue LoadError raise end -YAML = Psych +YAML = Psych # :nodoc: module Psych # :nodoc: # For compatibility, deprecated diff --git a/lib/yaml/dbm.rb b/lib/yaml/dbm.rb index 976fdb3bb6..c979224561 100644 --- a/lib/yaml/dbm.rb +++ b/lib/yaml/dbm.rb @@ -15,11 +15,13 @@ module YAML # # See the documentation for ::DBM and ::YAML for more information. class DBM < ::DBM - VERSION = "0.1" + VERSION = "0.1" # :nodoc: # Return value associated with +key+ from database. # # Returns +nil+ if there is no such +key+. + # + # See #fetch for more information. def []( key ) fetch( key ) end @@ -30,6 +32,8 @@ class DBM < ::DBM # Set +key+ to +value+ in database. # # +value+ will be converted to YAML before storage. + # + # See #store for more information. def []=( key, val ) store( key, val ) end @@ -43,6 +47,8 @@ class DBM < ::DBM # If there is no value for +key+ and no block is given, returns +ifnone+. # # Otherwise, calls block passing in the given +key+. + # + # See ::DBM#fetch for more information. def fetch( keystr, ifnone = nil ) begin val = super( keystr ) @@ -67,6 +73,10 @@ class DBM < ::DBM super( keystr.to_yaml ) end + # :call-seq: + # db.key(value) -> string + # + # Returns the key for the specified value. def key( keystr ) invert[keystr] end |