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.
new([default])
Returns a newly created properties set
with default properties default .
Instance Methods:
self[key[, default]]
getProperty(key[, default])
Returns the value of the property specified by key .
When there is not the property,
returns the default value default if it is specified,
returns nil otherwise.
self[key]=val
setProperty(key, val)
Sets a value val to the property
which has the specified name key .
Returns the previous value,
or nil when the property has no value.
load(file)
Reads properties
from a file if file is String ,
from a stream if file is IO .
save(file)
Writes properties
to a file if file is String ,
to a stream if file is IO .
default
default=default_prop
Properties object for dafault values.
list(port)
dump(port)
Writes properties list to port stream. (for debug)