Class: Taggata::Persistent::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/taggata/persistent/abstract.rb

Direct Known Subclasses

Directory, File, FileTag, Tag

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bulk_insert(db, values) ⇒ Object



21
22
23
# File 'lib/taggata/persistent/abstract.rb', line 21

def self.bulk_insert(db, values)
  db.bulk_insert(self, values)
end

.destroy(db, options) ⇒ Object



9
10
11
# File 'lib/taggata/persistent/abstract.rb', line 9

def self.destroy(db, options)
  db.destroy(self, options)
end

.find(db, options) ⇒ Object



25
26
27
# File 'lib/taggata/persistent/abstract.rb', line 25

def self.find(db, options)
  db.find(self, options)
end

.find_one(db, options) ⇒ Object



17
18
19
# File 'lib/taggata/persistent/abstract.rb', line 17

def self.find_one(db, options)
  db.find_one(self, options)
end

.find_or_create(db, options) ⇒ Object



29
30
31
# File 'lib/taggata/persistent/abstract.rb', line 29

def self.find_or_create(db, options)
  db.find_or_create(self, options)
end

.new_from_hash(db, hash) ⇒ Object

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/taggata/persistent/abstract.rb', line 40

def self.new_from_hash(db, hash)
  raise NotImplementedError
end

.tableObject

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/taggata/persistent/abstract.rb', line 44

def self.table
  raise NotImplementedError
end

Instance Method Details

#destroy(options = {}) ⇒ Object



13
14
15
# File 'lib/taggata/persistent/abstract.rb', line 13

def destroy(options = {})
  db.destroy(self.class, self.to_hash)
end

#invalidate_cacheObject



33
34
# File 'lib/taggata/persistent/abstract.rb', line 33

def invalidate_cache
end

#saveObject



5
6
7
# File 'lib/taggata/persistent/abstract.rb', line 5

def save
  @id ||= db.save(self)
end

#show(indent = 0) ⇒ Object



48
49
# File 'lib/taggata/persistent/abstract.rb', line 48

def show(indent = 0)
end

#to_hashObject

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/taggata/persistent/abstract.rb', line 36

def to_hash
  raise NotImplementedError
end