content="text/html; charset=iso-2022-jp"> previous - up - next - index
The Properties
class provides
simple properties database able to be {stored into/restored from}
human-readable format file.
Property is a mapping from key to value
used as resources by applications.
For objects val used as property values, eval(val.inspect) == val
must hold
so that you can restore properties after storing.
If not so, you must implement
an appropriate inspect
method for value class.
Example:
default = Properties.new default.load('test.default') prop = Properties.new(default) prop.load('dot.testrc') print("dict_file = "); p(prop['dict_file'])
new([default])
self[key[, default]]
getProperty(key[, default])
nil
otherwise.
self[key]=val
setProperty(key, val)
nil
when the property has no value.
load(file)
String
,
from a stream if file is IO
.
save(file)
String
,
to a stream if file is IO
.
default
default=default_prop
list(port)
dump(port)
Generated at Mon Mar 08 17:05:27 JST 1999 by rubyapi2