nano-store 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. data/{CHANGELOG → CHANGELOG.md} +7 -0
  2. data/README.md +5 -1
  3. data/Rakefile +1 -1
  4. data/lib/nano_store.rb +1 -1
  5. data/lib/nano_store/finder.rb +10 -2
  6. data/lib/nano_store/model.rb +7 -7
  7. data/lib/nano_store/version.rb +1 -1
  8. data/spec/association_spec.rb +6 -6
  9. data/spec/finder_spec.rb +2 -0
  10. data/spec/model_spec.rb +33 -3
  11. data/spec/nano_store_spec.rb +5 -0
  12. data/spec/spec_helper.rb +14 -0
  13. data/vendor/Podfile.lock +3 -3
  14. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoBag.h +6 -1
  15. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoEngine.h +5 -0
  16. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoEngine_Private.h +2 -0
  17. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoExpression.h +6 -0
  18. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoExpression_Private.h +1 -1
  19. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoGlobals.h +5 -1
  20. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoGlobals_Private.h +6 -2
  21. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoObject.h +15 -3
  22. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoObject_Private.h +4 -0
  23. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoPredicate.h +6 -1
  24. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoResult.h +5 -0
  25. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoSearch.h +16 -2
  26. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoSortDescriptor.h +7 -1
  27. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoStore.h +12 -0
  28. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoStore_Private.h +3 -1
  29. data/vendor/Pods/BuildHeaders/NanoStore/NSFOrderedDictionary.h +33 -0
  30. data/vendor/Pods/BuildHeaders/NanoStore/NanoStore.h +36 -0
  31. data/vendor/Pods/Headers/NanoStore/NSFNanoBag.h +6 -1
  32. data/vendor/Pods/Headers/NanoStore/NSFNanoEngine.h +5 -0
  33. data/vendor/Pods/Headers/NanoStore/NSFNanoEngine_Private.h +2 -0
  34. data/vendor/Pods/Headers/NanoStore/NSFNanoExpression.h +6 -0
  35. data/vendor/Pods/Headers/NanoStore/NSFNanoExpression_Private.h +1 -1
  36. data/vendor/Pods/Headers/NanoStore/NSFNanoGlobals.h +5 -1
  37. data/vendor/Pods/Headers/NanoStore/NSFNanoGlobals_Private.h +6 -2
  38. data/vendor/Pods/Headers/NanoStore/NSFNanoObject.h +15 -3
  39. data/vendor/Pods/Headers/NanoStore/NSFNanoObject_Private.h +4 -0
  40. data/vendor/Pods/Headers/NanoStore/NSFNanoPredicate.h +6 -1
  41. data/vendor/Pods/Headers/NanoStore/NSFNanoResult.h +5 -0
  42. data/vendor/Pods/Headers/NanoStore/NSFNanoSearch.h +16 -2
  43. data/vendor/Pods/Headers/NanoStore/NSFNanoSortDescriptor.h +7 -1
  44. data/vendor/Pods/Headers/NanoStore/NSFNanoStore.h +12 -0
  45. data/vendor/Pods/Headers/NanoStore/NSFNanoStore_Private.h +3 -1
  46. data/vendor/Pods/Headers/NanoStore/NSFOrderedDictionary.h +33 -0
  47. data/vendor/Pods/Headers/NanoStore/NanoStore.h +36 -0
  48. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoEngine.h +5 -0
  49. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoEngine.m +142 -131
  50. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoResult.h +5 -0
  51. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoResult.m +148 -51
  52. data/vendor/Pods/NanoStore/Classes/Advanced/NSFOrderedDictionary.h +33 -0
  53. data/vendor/Pods/NanoStore/Classes/Advanced/NSFOrderedDictionary.m +148 -0
  54. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoEngine_Private.h +2 -0
  55. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoExpression_Private.h +1 -1
  56. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoGlobals_Private.h +6 -2
  57. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoObject_Private.h +4 -0
  58. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoStore_Private.h +3 -1
  59. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoBag.h +6 -1
  60. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoBag.m +126 -117
  61. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.h +6 -0
  62. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.m +32 -18
  63. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoGlobals.h +5 -1
  64. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoGlobals.m +6 -3
  65. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoObject.h +15 -3
  66. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoObject.m +152 -31
  67. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoPredicate.h +6 -1
  68. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoPredicate.m +51 -26
  69. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.h +16 -2
  70. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.m +156 -115
  71. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSortDescriptor.h +7 -1
  72. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSortDescriptor.m +34 -17
  73. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoStore.h +12 -0
  74. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoStore.m +210 -196
  75. data/vendor/Pods/NanoStore/Classes/Public/NanoStore.h +36 -0
  76. data/vendor/Pods/NanoStore/README.md +49 -0
  77. data/vendor/Pods/Pods.bridgesupport +798 -685
  78. metadata +30 -8
@@ -1,3 +1,9 @@
1
+ # [0.6.0](https://github.com/siuying/NanoStoreInMotion/compare/v0.5.2%E2%80%A6v0.6.0)
2
+
3
+ - Update for NanoStore 2.5.3, some notable changes:
4
+ - accept nil and NSURL fields in model
5
+ - can set store per instance
6
+
1
7
  # [0.5.2](https://github.com/siuying/NanoStoreInMotion/compare/v0.5.1%E2%80%A6v0.5.2)
2
8
 
3
9
  - Fix load error on older version of RubyMotion (or that disabled detect_dependencies)
@@ -5,6 +11,7 @@
5
11
  # [0.5.1](https://github.com/siuying/NanoStoreInMotion/compare/v0.5.0%E2%80%A6v0.5.1)
6
12
 
7
13
  - Update to NanoStore 2.1.6
14
+ - Convert predicate value to string, to fix type error that happen if attriutes are values other than string
8
15
 
9
16
  # [0.5.0](https://github.com/siuying/NanoStoreInMotion/compare/v0.4.3%E2%80%A6v0.5.0)
10
17
 
data/README.md CHANGED
@@ -4,6 +4,10 @@ Wrapper for NanoStore, a lightweight schema-less key-value document database bas
4
4
 
5
5
  Status: Work in progress. API subject to change.
6
6
 
7
+ Find a sample application using NanoStore [here](https://github.com/ankit8898/NanoStoreInMotion-example)
8
+
9
+ How to use Blog [here](http://ankitinstinct.blogspot.in/2012/12/rubymotion-application-with.html)
10
+
7
11
  ## Installation
8
12
 
9
13
  Install the CocoaPods dependency manager if you haven't it already:
@@ -29,7 +33,7 @@ Motion::Project::App.setup do |app|
29
33
 
30
34
  # Add the pod NanoStore to your project
31
35
  app.pods do
32
- pod 'NanoStore', '~> 2.1.8'
36
+ pod 'NanoStore', '~> 2.5.3'
33
37
  end
34
38
  end
35
39
  ```
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Motion::Project::App.setup do |app|
9
9
  app.redgreen_style = :full
10
10
  app.files += Dir.glob(File.join(app.project_dir, 'lib/nano_store/*.rb'))
11
11
  app.pods do
12
- pod 'NanoStore', '~> 2.1.8'
12
+ pod 'NanoStore', '~> 2.5.3'
13
13
  end
14
14
  end
15
15
 
@@ -16,5 +16,5 @@ Motion::Project::App.setup do |app|
16
16
  app.files.unshift(File.join(File.dirname(__FILE__), 'nano_store/finder.rb'))
17
17
 
18
18
  app.pods ||= Motion::Project::CocoaPods.new(app)
19
- app.pods.pod 'NanoStore', '~> 2.1.8'
19
+ app.pods.pod 'NanoStore', '~> 2.5.3'
20
20
  end
@@ -60,7 +60,11 @@ module NanoStore
60
60
  searchResults = search.searchObjectsWithReturnType(NSFReturnObjects, error:error_ptr)
61
61
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
62
62
 
63
- searchResults
63
+ if searchResults.is_a?(NSDictionary)
64
+ searchResults.values
65
+ else
66
+ searchResults
67
+ end
64
68
  end
65
69
 
66
70
  # find model keys by criteria
@@ -109,7 +113,11 @@ module NanoStore
109
113
  searchResults = search.searchObjectsWithReturnType(NSFReturnKeys, error:error_ptr)
110
114
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
111
115
 
112
- searchResults
116
+ if searchResults.is_a?(NSDictionary)
117
+ searchResults.values
118
+ else
119
+ searchResults
120
+ end
113
121
  end
114
122
 
115
123
  # find a model by key
@@ -4,7 +4,7 @@ module NanoStore
4
4
  raise NanoStoreError, 'No store provided' unless self.class.store
5
5
 
6
6
  error_ptr = Pointer.new(:id)
7
- self.class.store.addObject(self, error:error_ptr)
7
+ self.store.addObject(self, error:error_ptr)
8
8
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
9
9
  self
10
10
  end
@@ -13,10 +13,14 @@ module NanoStore
13
13
  raise NanoStoreError, 'No store provided' unless self.class.store
14
14
 
15
15
  error_ptr = Pointer.new(:id)
16
- self.class.store.removeObject(self, error: error_ptr)
16
+ self.store.removeObject(self, error: error_ptr)
17
17
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
18
18
  self
19
19
  end
20
+
21
+ def store
22
+ super || self.class.store
23
+ end
20
24
  end
21
25
 
22
26
  module ModelClassMethods
@@ -46,11 +50,7 @@ module NanoStore
46
50
  end
47
51
 
48
52
  define_method((name + "=").to_sym) do |*args, &block|
49
- if args[0].nil?
50
- self.info.delete(name.to_sym)
51
- else
52
- self.info[name] = args[0]
53
- end
53
+ self.info[name] = args[0]
54
54
  end
55
55
  end
56
56
 
@@ -1,3 +1,3 @@
1
1
  module NanoStore
2
- VERSION = "0.5.2"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -46,12 +46,12 @@ describe "Associations" do
46
46
  todo.items.is_a?(NanoStore::Bag).should == true
47
47
  todo.save
48
48
 
49
- todo2 = Todo.find(:title => "Today Tasks").first
50
- todo2.should.not.be.nil
51
- todo2.items.is_a?(NSFNanoBag).should == true
52
- todo2.items.key.should == todo.items.key
53
- todo2.items.size.should == 3
54
- todo2.items.to_a.each do |item|
49
+ todo = Todo.find(:title => "Today Tasks").first
50
+ todo.should.not.be.nil
51
+ todo.items.is_a?(NanoStore::Bag).should == true
52
+ todo.items.key.should == todo.items.key
53
+ todo.items.size.should == 3
54
+ todo.items.to_a.each do |item|
55
55
  item.is_a?(TodoItem).should.be.true
56
56
  end
57
57
  end
@@ -43,6 +43,8 @@ describe "Finder" do
43
43
  it "search object traditional way: supply key, operator and value" do
44
44
  users = User.find(:name, NSFEqualTo, "Bob")
45
45
  users.should.not.be.nil
46
+ users.is_a?(Array).should.be.true
47
+
46
48
  user = users.first
47
49
  user.should.not.be.nil
48
50
  user.name.should.be == "Bob"
@@ -1,5 +1,4 @@
1
1
  describe NanoStore::Model do
2
-
3
2
  class User < NanoStore::Model
4
3
  attribute :name
5
4
  attribute :age
@@ -14,7 +13,7 @@ describe NanoStore::Model do
14
13
  class Listing < NanoStore::Model
15
14
  attribute :name
16
15
  end
17
-
16
+
18
17
  def stub_user(name, age, created_at)
19
18
  user = User.new
20
19
  user.name = name
@@ -76,7 +75,29 @@ describe NanoStore::Model do
76
75
  end
77
76
 
78
77
  describe "#save" do
79
- it "update objects" do
78
+ it "if no store set, create objects using shared store" do
79
+ user = stub_user("Bob", 10, Time.now)
80
+ user.save
81
+ NanoStore.shared_store.count(User).should == 1
82
+ end
83
+
84
+ # per object store since NanoStore 2.5.1
85
+ it "user per instance store to save" do
86
+ store1 = NanoStore.store
87
+ user = stub_user("Bob", 10, Time.now)
88
+ user.store = store1
89
+ user.save
90
+ store1.count(User).should == 1
91
+
92
+ store2 = NanoStore.store
93
+ user2 = stub_user("Lee", 10, Time.now)
94
+ user2.store = store2
95
+ user2.save
96
+ store2.count(User).should == 1
97
+ store1.count(User).should == 1
98
+ end
99
+
100
+ it "update existing objects" do
80
101
  user = stub_user("Bob", 10, Time.now)
81
102
  user.save
82
103
 
@@ -87,6 +108,15 @@ describe NanoStore::Model do
87
108
  user2 = User.find(:name, NSFEqualTo, "Dom").first
88
109
  user2.key.should == user.key
89
110
  end
111
+
112
+ it "create with nil field" do
113
+ user = stub_user("Bob", 10, nil)
114
+ user.save
115
+
116
+ user1 = User.find(:name, NSFEqualTo, "Bob").first
117
+ user1.name.should == "Bob"
118
+ user1.created_at.should.be.nil
119
+ end
90
120
  end
91
121
 
92
122
  describe "#delete" do
@@ -7,6 +7,11 @@ describe NanoStore do
7
7
  NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0]
8
8
  end
9
9
 
10
+ after do
11
+ path = documents_path + "/nano.db"
12
+ File.delete(path) rescue nil
13
+ end
14
+
10
15
  it "create :memory store" do
11
16
  store = NanoStore.store
12
17
  store.filePath.should == ":memory:"
@@ -0,0 +1,14 @@
1
+ class User < NanoStore::Model
2
+ attribute :name
3
+ attribute :age
4
+ attribute :created_at
5
+ end
6
+
7
+ class Plane < NanoStore::Model
8
+ attribute :name
9
+ attribute :age
10
+ end
11
+
12
+ class Listing < NanoStore::Model
13
+ attribute :name
14
+ end
@@ -1,11 +1,11 @@
1
1
 
2
2
  PODS:
3
- - NanoStore (2.1.8)
3
+ - NanoStore (2.5.3)
4
4
 
5
5
  DEPENDENCIES:
6
- - NanoStore (~> 2.1.8)
6
+ - NanoStore (~> 2.5.3)
7
7
 
8
8
  SPEC CHECKSUMS:
9
- NanoStore: 648b6b984d4df8ad52a1c0d049ad91b8a12a27d0
9
+ NanoStore: ea3eabc945dbd7d80678da2b0aed669f683d239f
10
10
 
11
11
  COCOAPODS: 0.16.0
@@ -302,11 +302,16 @@
302
302
 
303
303
  /** * Returns a string representation of the bag.
304
304
  * @note Check properties savedObjects, unsavedObjects and removedObjects to find out the current state of the bag.
305
- * @see \link dictionaryRepresentation - (NSDictionary *)dictionaryRepresentation \endlink
306
305
  */
307
306
 
308
307
  - (NSString *)description;
309
308
 
309
+ /** Returns a JSON representation of the bag.
310
+ * @note Check properties savedObjects, unsavedObjects and removedObjects to find out the current state of the bag.
311
+ */
312
+
313
+ - (NSString *)JSONDescription;
314
+
310
315
  //@}
311
316
 
312
317
  @end
@@ -537,6 +537,11 @@
537
537
 
538
538
  - (NSString *)description;
539
539
 
540
+ /** Returns a JSON representation of the engine.
541
+ */
542
+
543
+ - (NSString *)JSONDescription;
544
+
540
545
  //@}
541
546
 
542
547
  @end
@@ -30,10 +30,12 @@
30
30
  #import "NSFNanoEngine.h"
31
31
  #import "NSFNanoGlobals_Private.h"
32
32
  #import "NSFNanoResult.h"
33
+ #import "NSFOrderedDictionary.h"
33
34
 
34
35
  /** \cond */
35
36
 
36
37
  @interface NSFNanoEngine (Private)
38
+ - (NSFOrderedDictionary *)dictionaryDescription;
37
39
  + (NSArray *)NSFP_sharedROWIDKeywords;
38
40
  - (NSString *)NSFP_cacheMethodToString;
39
41
  - (NSString*)NSFP_nestedDescriptionWithPrefixedSpace:(NSString *)prefixedSpace;
@@ -120,6 +120,12 @@
120
120
 
121
121
  - (NSString *)description;
122
122
 
123
+ /** Returns a JSON representation of the expression.
124
+ * @note Check properties predicates and operators to find out the current state of the expression.
125
+ */
126
+
127
+ - (NSString *)JSONDescription;
128
+
123
129
  //@}
124
130
 
125
131
  @end
@@ -29,7 +29,7 @@
29
29
  /** \cond */
30
30
 
31
31
  @interface NSFNanoExpression (Private)
32
- // Just a placeholder.
32
+ - (NSArray *)arrayDescription;
33
33
  @end
34
34
 
35
35
  /** \endcond */
@@ -71,7 +71,11 @@ typedef enum {
71
71
  /** * Used to store NSDate elements in the format <i>yyyy-MM-dd HH:mm:ss:SSS</i>. Its string equivalent is <b>TEXT</b>. */
72
72
  NSFNanoTypeDate,
73
73
  /** * Used to store NSNumber elements. Its string equivalent is <b>REAL</b>. */
74
- NSFNanoTypeNumber
74
+ NSFNanoTypeNumber,
75
+ /** * Used to store NSNull elements. Its string equivalent is <b>NULL</b>. */
76
+ NSFNanoTypeNULL,
77
+ /** * Used to store NSURL elements. Its string equivalent is <b>URL</b>. */
78
+ NSFNanoTypeURL
75
79
  } NSFNanoDatatype;
76
80
 
77
81
  /** * Returns the name of a NSFNanoDatatype datatype as a string. */
@@ -53,6 +53,10 @@
53
53
 
54
54
  */
55
55
 
56
+ extern NSDictionary * safeJSONDictionaryFromDictionary (NSDictionary *dictionary);
57
+ extern NSArray * safeJSONArrayFromArray (NSArray *array);
58
+ extern id safeJSONObjectFromObject (id object);
59
+
56
60
  extern NSString * NSFStringFromMatchType (NSFMatchType aMatchType);
57
61
 
58
62
  extern void _NSFLog (NSString *format, ...);
@@ -67,13 +71,13 @@ extern NSString * const NSFValue;
67
71
  extern NSString * const NSFDatatype;
68
72
  extern NSString * const NSFCalendarDate;
69
73
  extern NSString * const NSFObjectClass;
70
- extern NSString * const NSFPlist;
74
+ extern NSString * const NSFKeyedArchive;
71
75
  extern NSString * const NSFAttribute;
72
76
 
73
77
  #pragma mark -
74
78
 
75
79
  extern NSString * const NSF_Private_NSFKeys_NSFKey;
76
- extern NSString * const NSF_Private_NSFKeys_NSFPlist;
80
+ extern NSString * const NSF_Private_NSFKeys_NSFKeyedArchive;
77
81
  extern NSString * const NSF_Private_NSFValues_NSFKey;
78
82
  extern NSString * const NSF_Private_NSFValues_NSFAttribute;
79
83
  extern NSString * const NSF_Private_NSFValues_NSFValue;
@@ -181,6 +181,8 @@
181
181
 
182
182
  @interface NSFNanoObject : NSObject <NSFNanoObjectProtocol, NSCopying>
183
183
 
184
+ /** * The store where the object is saved. */
185
+ @property (nonatomic, weak, readonly) NSFNanoStore *store;
184
186
  /** * The UUID of the NanoObject. */
185
187
  @property (nonatomic, copy, readonly) NSString *key;
186
188
  /** * The user-supplied information of the NanoObject. */
@@ -304,6 +306,13 @@
304
306
 
305
307
  - (BOOL)isEqualToNanoObject:(NSFNanoObject *)otherNanoObject;
306
308
 
309
+ /** * Saves the uncommitted changes to the document store.
310
+ * @param outError is used if an error occurs. May be NULL.
311
+ * @return YES upon success, NO otherwise.
312
+ */
313
+
314
+ - (BOOL)saveStoreAndReturnError:(out NSError **)outError;
315
+
307
316
  /** * Returns a dictionary that contains the information stored in the object.
308
317
  * @note Check properties info and key to find out the current state of the object.
309
318
  * @see \link description - (NSString *)description \endlink
@@ -311,13 +320,16 @@
311
320
 
312
321
  - (NSDictionary *)dictionaryRepresentation;
313
322
 
314
- /** * Returns a string representation of the bag.
315
- * @note Check properties info and key to find out the current state of the object.
316
- * @see \link dictionaryRepresentation - (NSString *)dictionaryRepresentation \endlink
323
+ /** * Returns a string representation of the nano object.
317
324
  */
318
325
 
319
326
  - (NSString *)description;
320
327
 
328
+ /** Returns a JSON representation of the nano object.
329
+ */
330
+
331
+ - (NSString *)JSONDescription;
332
+
321
333
  //@}
322
334
 
323
335
  @end
@@ -30,6 +30,10 @@
30
30
 
31
31
  @interface NSFNanoObject (Private)
32
32
  - (void)_setOriginalClassString:(NSString *)theClassString;
33
+ + (NSString *)_NSObjectToJSONString:(id)object error:(NSError **)error;
34
+ + (NSDictionary *)_safeDictionaryFromDictionary:(NSDictionary *)dictionary;
35
+ + (NSArray *)_safeArrayFromArray:(NSArray *)array;
36
+ + (id)_safeObjectFromObject:(id)object;
33
37
  @end
34
38
 
35
39
  /** \endcond */
@@ -113,11 +113,16 @@
113
113
 
114
114
  /** * Returns a string representation of the predicate.
115
115
  * @note Check properties column, match and value to find out the current state of the predicate.
116
- * @see \link description - (NSString *)description \endlink
117
116
  */
118
117
 
119
118
  - (NSString *)description;
120
119
 
120
+ /** * Returns a JSON representation of the predicate.
121
+ * @note Check properties column, match and value to find out the current state of the predicate.
122
+ */
123
+
124
+ - (NSString *)JSONDescription;
125
+
121
126
  //@}
122
127
 
123
128
  @end
@@ -132,6 +132,11 @@
132
132
 
133
133
  - (NSString *)description;
134
134
 
135
+ /** Returns a JSON representation of the result.
136
+ */
137
+
138
+ - (NSString *)JSONDescription;
139
+
135
140
  //@}
136
141
 
137
142
  @end