Module: ActiveObjectTokyoCabinet::ClassMethods

Defined in:
lib/active_object/adapters/tokyo_cabinet.rb

Instance Method Summary collapse

Instance Method Details

#allObject



19
20
21
22
23
24
25
26
# File 'lib/active_object/adapters/tokyo_cabinet.rb', line 19

def all
	keys = adb.keys(:prefix=>"#{self.to_s}_")
	records = []
	keys.each do |key|
		records << find(key_to_id(key))
	end
	records
end

#delete(id) ⇒ Object



15
16
17
# File 'lib/active_object/adapters/tokyo_cabinet.rb', line 15

def delete(id)
	adb.delete(self.id_to_key(id))
end