Module: WingedCouch::Models::Persistence::ClassMethods

Defined in:
lib/winged_couch/models/persistence.rb

Overview

Module with class methods for persistence

Instance Method Summary collapse

Instance Method Details

#databaseWingedCouch::Database

Returns database for current model

Returns:

  • (WingedCouch::Database)

26
27
28
29
30
# File 'lib/winged_couch/models/persistence.rb', line 26

def database
  database = WingedCouch::Native::Database.new(database_name)
  database.create unless database.exist?
  database
end