| Class | Store |
| In: |
lib/storage/store.rb
|
| Parent: | Object |
The Store class is an abstract class defining the methods needed to access a data store
Construct store
# File lib/storage/store.rb, line 57 def initialize @dbtop = 0 end
Check if an object is in the database by its id.
# File lib/storage/store.rb, line 93 def check(oid) false end
Deletes an object from the database.
# File lib/storage/store.rb, line 112 def delete(oid) end
Iterate through all objects
# File lib/storage/store.rb, line 117 def each end
Finds an object in the database by its id.
# File lib/storage/store.rb, line 86 def get(oid) nil end
Fetch the next available id.
# File lib/storage/store.rb, line 79 def getid @dbtop+=1 end
Marks an object nonswappable
# File lib/storage/store.rb, line 123 def makenoswap(oid) end
Marks an object swappable
# File lib/storage/store.rb, line 129 def makeswap(oid) end
Marks an object dirty
# File lib/storage/store.rb, line 100 def mark(oid) end
produces a statistical report of the database
# File lib/storage/store.rb, line 134 def stats rooms = objs = scripts = characters = accounts = 0 self.each do |val| case val when Room rooms += 1 when Character characters += 1 when GameObject objs += 1 when Script scripts += 1 when Account accounts += 1 end end stats="[COLOR Cyan]\n---* Database Statistics *---\n Rooms - \#{rooms}\n Objects - \#{objs}\n Scripts - \#{scripts}\n Accounts - \#{accounts}\n Characters - \#{characters}\n Total Objects - \#{rooms+objs+characters+accounts+scripts}\n Highest OID in use - \#{@dbtop}\n---* *---\n[/COLOR]\n" end