Class: Caster::MetadataDocument

Inherits:
Object
  • Object
show all
Includes:
MetadataStore
Defined in:
lib/caster/metadata/metadata_document.rb

Instance Method Summary collapse

Instance Method Details

#descObject



10
11
12
# File 'lib/caster/metadata/metadata_document.rb', line 10

def desc
  'source database'
end

#get_db_version(database) ⇒ Object



14
15
16
17
# File 'lib/caster/metadata/metadata_document.rb', line 14

def get_db_version database
  db = CouchRest.database! "http://#{Caster.config['host']}:#{Caster.config['port']}/#{database}"
  get_metadoc(db)[db.name] rescue nil
end

#save_db_version(database, version) ⇒ Object



19
20
21
22
23
24
# File 'lib/caster/metadata/metadata_document.rb', line 19

def save_db_version database, version
  db = CouchRest.database! "http://#{Caster.config['host']}:#{Caster.config['port']}/#{database}"
  metadoc = get_metadoc(db)
  metadoc[database] = version
  db.save_doc metadoc
end