parsecom 0.5.7 → 0.5.8

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.
data/README.md CHANGED
@@ -350,7 +350,7 @@ game_scores = GameScore.find :where => proc {
350
350
  #### Counting Objects
351
351
 
352
352
  ```ruby
353
- game_scores = GameScore.find :where => {'playerName' => 'Jonathan Walsh'}, :count => true, :limit => 0
353
+ game_scores = GameScore.count 'playerName' => 'Jonathan Walsh'
354
354
  game_scores.query_count
355
355
  ```
356
356
 
data/lib/parse/object.rb CHANGED
@@ -77,6 +77,16 @@ module Parse
77
77
  def find_all! opts={}
78
78
  find! :all, opts
79
79
  end
80
+
81
+ def count condition=nil, &block
82
+ opts = {:limit => 0, :count => true}
83
+ if condition
84
+ opts[:where] = condition
85
+ elsif block
86
+ opts[:where] = block
87
+ end
88
+ find(:all, opts).query_count
89
+ end
80
90
  end
81
91
 
82
92
  attr_accessor :parse_object_id, :created_at, :updated_at, :acl
data/lib/parse/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Parse
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
data/lib/parsecom.rb CHANGED
@@ -14,7 +14,6 @@ require 'parse/util'
14
14
  require 'parse/http_client'
15
15
  require 'parse/client'
16
16
  require 'parse/query'
17
- require 'parse/query_result'
18
17
  require 'parse/acl'
19
18
  require 'parse/object'
20
19
  require 'parse/user'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsecom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: