Module: CouchRestRails

Defined in:
lib/couch_rest_rails.rb,
lib/couch_rest_rails/views.rb,
lib/couch_rest_rails/tests.rb,
lib/couch_rest_rails/lucene.rb,
lib/couch_rest_rails/database.rb,
lib/couch_rest_rails/document.rb,
lib/couch_rest_rails/fixtures.rb

Defined Under Namespace

Modules: Database, Fixtures, Lucene, Tests, Views Classes: Document

Instance Method Summary (collapse)

Instance Method Details

- (Object) process_database_method(database_name, &block)



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/couch_rest_rails.rb', line 18

def process_database_method(database_name, &block)
  # If wildcard passed, use model definitions for database names
  if database_name == '*'
    databases = CouchRestRails::Database.list
  elsif database_name.is_a? Array
    databases = database_name
  else
    databases = [database_name]
  end
  response = ['']
  databases.each do |database|
    yield database, response
  end
  response << ''
  response.join("\n")
end