factual-api 1.0.2 → 1.0.3

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 (4) hide show
  1. data/CHANGELOG.md +3 -0
  2. data/README.md +5 -0
  3. data/lib/factual.rb +6 -2
  4. metadata +2 -2
@@ -1,3 +1,6 @@
1
+ ## v1.0.3
2
+ * adding crosswalk(namespace_id, namespace)
3
+
1
4
  ## v1.0.2
2
5
  * lazy getting total_count of a query
3
6
  * changed Query#total_rows to Query#total_count to be consistent
data/README.md CHANGED
@@ -69,6 +69,11 @@ factual.table("restaurants-us")
69
69
  FACTUAL_ID = "110ace9f-80a7-47d3-9170-e9317624ebd9"
70
70
  query = factual.crosswalk(FACTUAL_ID)
71
71
  query.rows
72
+
73
+ # Or specify a place with its namespace_id and namespace
74
+ SIMPLEGEO_ID = "SG_6XIEi3qehN44LH8m8i86v0"
75
+ query = factual.crosswalk(SIMPLEGEO_ID, :simplegeo)
76
+ query.rows
72
77
  ````
73
78
 
74
79
  ## Simple Resolve Example
@@ -13,8 +13,12 @@ class Factual
13
13
  Query::Table.new(@api, "t/#{table_id_or_alias}")
14
14
  end
15
15
 
16
- def crosswalk(factual_id)
17
- Query::Crosswalk.new(@api, :factual_id => factual_id)
16
+ def crosswalk(namespace_id, namespace = nil)
17
+ if namespace
18
+ Query::Crosswalk.new(@api, :namespace_id => namespace_id, :namespace => namespace)
19
+ else
20
+ Query::Crosswalk.new(@api, :factual_id => namespace_id)
21
+ end
18
22
  end
19
23
 
20
24
  def resolve(values)
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.2
5
+ version: 1.0.3
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-03-07 00:00:00 +08:00
14
+ date: 2012-03-13 00:00:00 +08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency