to_a

sdbm.to_a â Array
Instance Public methods

Returns a new Array containing each key-value pair in the database.

Example:

require 'sdbm'

SDBM.open 'my_database' do |db|
  db.update('apple' => 'fruit', 'spinach' => 'vegetable')

  db.to_a  #=> [["apple", "fruit"], ["spinach", "vegetable"]]
end
doc_ruby_on_rails
2015-05-14 04:59:10
Comments
Leave a Comment

Please login to continue.