All instance methods has the same syntax than the methods of Array
create a new temporary db file, populated with the given object
open the database
- options
- set_flags
general database configuration
- set_cachesize
set the database cache size
- set_pagesize
set the underlying database page size
- set_lorder
set the database byte order
- set_re_delim
set the variable-length record delimiter
- set_re_len
set the fixed-length record length
- set_re_pad
set the fixed-length record pad byte
retrieves the nth item from an array. Index starts from zero. If
index is the negative, counts backward from the end of the array. The index
of the last element is -1. Returns nil, if the nth
element is not exist in the array.
returns an array containing the objects from start to
end, including both ends. if end is larger than the length of the
array, it will be rounded to the length. If start is out of an
array range , returns nil. And if start is larger than
end with in array range, returns empty array ([]).
returns an array containing length items from start.
Returns nil if length is negative.
changes the nth element of the array into val. If
nth is larger than array length, the array shall be extended
automatically. Extended region shall be initialized by nil.
replace the items from start to end with val. If
val is not an array, the type of val will be converted
into the Array using to_a
method.
replace the length items from start with val. If
val is not an array, the type of val will be converted
into the Array using to_a.
returns a new array which contains elements belong to both elements.
append a new item with value obj. Return self
comparison : return -1, 0 or 1
Returns a new array by invoking block once for every element, passing each
element as a parameter to block. The result of block is used as the given
element
invokes block once for each element of db, replacing the element with the
value returned by block.
delete the item which matches to val
delete the item if the block return true
delete the item if the block return true
return true if the db file is empty
set the entire db with val
fill the db with val from start
set the db with val from start to end
returns true if the given val is present
returns the index of the item which equals to val. If no item
found, returns nil
returns an array consisting of elements at the given indices
returns an array consisting of elements at the given indices
returns a string created by converting each element to a string
return the number of elements of the db file
return the number of non-nil elements of the db file
pops and returns the last value
replaces the contents of the db file with the contents of other
returns the array of the items in reverse order
replaces the items in reverse order.
iterate over each item in reverse order
returns the index of the last item which verify item == val
remove and return the first element
return an Array with all elements
insert obj to the front of the db file