DbMotion 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/DbMotion/database.rb +7 -2
- data/lib/DbMotion/version.rb +1 -1
- metadata +2 -2
data/lib/DbMotion/database.rb
CHANGED
@@ -9,13 +9,18 @@ class Database
|
|
9
9
|
NSEntityDescription.insertNewObjectForEntityForName(_name, inManagedObjectContext:@context)
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
# Example: _sort=[NSSortDescriptor.alloc.initWithKey('name', ascending:true)]
|
13
|
+
def find_entry(_name, _sort=[])
|
13
14
|
request = NSFetchRequest.alloc.init
|
14
15
|
request.entity = NSEntityDescription.entityForName(_name, inManagedObjectContext:@context)
|
15
|
-
|
16
|
+
request.sortDescriptors = _sort
|
16
17
|
error_ptr = Pointer.new(:object)
|
17
18
|
@context.executeFetchRequest(request, error:error_ptr)
|
18
19
|
end
|
20
|
+
|
21
|
+
def delete_entry(_obj)
|
22
|
+
@context.deleteObject(_obj)
|
23
|
+
end
|
19
24
|
|
20
25
|
def save
|
21
26
|
error_ptr = Pointer.new(:object)
|
data/lib/DbMotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: DbMotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: DbMotion a simple adaption of CoreData.
|
15
15
|
email:
|