factual-api 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## v1.0.2
2
+ * lazy getting total_count of a query
3
+ * changed Query#total_rows to Query#total_count to be consistent
4
+
1
5
  ## v1.0.1
2
6
  * fixed url escape for .filters(:category => "Food & Beverage > Restaurants")
3
7
 
@@ -11,9 +11,9 @@ class Factual
11
11
  @access_token = access_token
12
12
  end
13
13
 
14
- def execute(query)
15
- params_with_count = query.params.merge(:include_count => true)
16
- handle_request(query.action || :read, query.path, params_with_count)
14
+ def execute(query, other_params={})
15
+ merged_params = query.params.merge(other_params)
16
+ handle_request(query.action || :read, query.path, merged_params)
17
17
  end
18
18
 
19
19
  def schema(query)
@@ -26,8 +26,9 @@ class Factual
26
26
  response["data"]
27
27
  end
28
28
 
29
- def total_rows
30
- response["total_row_count"]
29
+ def total_count
30
+ resp = @api.execute(self, :include_count => true, :limit => 1)
31
+ resp["total_row_count"]
31
32
  end
32
33
 
33
34
  def schema
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: factual-api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rudiger Lippert
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2012-01-31 00:00:00 +08:00
14
+ date: 2012-03-07 00:00:00 +08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency