Class: Xampl::DumbPersister

Inherits:
Persister show all
Defined in:
lib/xamplr/persisters/dumb.rb

Instance Attribute Summary

Attributes inherited from Persister

#automatic, #block_changes, #cache_hits, #expunged, #format, #last_write_count, #name, #read_count, #rolled_back, #slow_sync, #syncing, #total_cache_hits, #total_read_count, #total_rollback_count, #total_sync_count, #total_write_count, #write_count

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Persister

#busy, #close, #count_changed, #do_sync_write, #done_sync_write, #expunge, #find_known, #find_xampl, #has_not_changed, #introduce, #is_busy, #lazy_load, #lookup, #optimise, #print_stats, #put_changed, #query_implemented, #realise, replace, #represent, #rollback, #rollback_cleanup, #shutdown, #start_sync_write, #sync

Constructor Details

#initialize(name = nil, format = nil, ignore = nil) ⇒ DumbPersister

Returns a new instance of DumbPersister.



5
6
7
8
9
10
# File 'lib/xamplr/persisters/dumb.rb', line 5

def initialize(name=nil, format=nil, ignore=nil)
  super(name, format)

  @module_map = {}
  @cache = {}
end

Class Method Details

.kindObject



12
13
14
# File 'lib/xamplr/persisters/dumb.rb', line 12

def DumbPersister.kind
  :dumb
end

Instance Method Details

#cache(xampl) ⇒ Object



27
28
29
# File 'lib/xamplr/persisters/dumb.rb', line 27

def cache(xampl)
  xampl
end

#clear_cacheObject



34
35
# File 'lib/xamplr/persisters/dumb.rb', line 34

def clear_cache
end

#has_changed(xampl) ⇒ Object



23
24
25
# File 'lib/xamplr/persisters/dumb.rb', line 23

def has_changed(xampl)
  throw :mixed_persisters unless self == xampl.persister
end

#kindObject



16
17
18
# File 'lib/xamplr/persisters/dumb.rb', line 16

def kind
  DumbPersister.kind
end

#read(klass, pid, target = nil) ⇒ Object



45
46
47
# File 'lib/xamplr/persisters/dumb.rb', line 45

def read(klass, pid, target=nil)
  return nil
end

#read_from_cache(klass, pid, target = nil) ⇒ Object



37
38
39
# File 'lib/xamplr/persisters/dumb.rb', line 37

def read_from_cache(klass, pid, target=nil)
  return nil, target
end

#sync_doneObject



20
21
# File 'lib/xamplr/persisters/dumb.rb', line 20

def sync_done
end

#uncache(xampl) ⇒ Object



31
32
# File 'lib/xamplr/persisters/dumb.rb', line 31

def uncache(xampl)
end

#write(xampl) ⇒ Object



41
42
43
# File 'lib/xamplr/persisters/dumb.rb', line 41

def write(xampl)
  return true
end