factual-api 1.3.13 → 1.3.14

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWM0ZDE5ZGM3YWUzN2UwYTFmMzZkNmEwN2E1MWNkNjliMGFiNWNlMg==
4
+ MjE1NGQ3OGYwYThmMzMxOWE4OTJmNWU4NDliN2IwNjQ2NTM1OTViNg==
5
5
  data.tar.gz: !binary |-
6
- NTJjMmQ5Y2MxYWZmOGU4YjNjYmEyZTZkYTcxOGM3ZjViZmZiMTIxNw==
6
+ MTcyYjY2NzJhNjdkN2EzZDg3OTJmN2Y5ZmU4ZjMxNjVkYWI4YzQ1ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGQ5ZmY3Nzg1MzIyMTZiNzYyMzM0MWU1YTZkODE4NzVkY2M2NGEyMjczZmUy
10
- OGVkYThjYjQxYzhmMzZjNjdhMGE2MDA0YzdjNGMwYjdlYmNhMzE1OGQ0OTE1
11
- NDUzY2FiNzVlYjM5ZDNhNWJiMDM3MWY4ZDFjNjE1NWJjZWE3ZTM=
9
+ ZGIzNTM3MDk0YTJhZTk1YjZkZDhkYWRhZDQ3OTU1MWNhYWEyMzYxNTZiM2Zm
10
+ MDI0ZTU3ZGVkMjYyNDUwOWU5NzJiOWU2ODU3YTkwNDdkMzViNTNhNDkwNTAz
11
+ M2MxYmFiNWJhMjNmOGQzOTA0OTIxOWEzYWQ4YjNjMTdjOWM1YTc=
12
12
  data.tar.gz: !binary |-
13
- NTFjZjdiZWQ2ZTdhNjljNDY3NjAxM2E2YTE0M2Y3M2I1ZjI3YzM5YjIxZGUy
14
- MzU1NWIxZWU2NzA5OThlMzk2NDRhODZkMTA4YjMyMmJlZDM3MDVlMTc4MDhk
15
- NjNmY2YyMDIxY2FjYTFhMmEyNmFkZjJjNGE5MmMyZjIyZGIyODI=
13
+ M2U5YjlmNWRmOTU5MTc1NDk5MjI3YTliOTEyNzA0ODFmYzg3NTVmM2M0NjFk
14
+ ODM0ZjA2NTg2YzljZWIzNjc3ZDljNWJhZTE2MjVlZTYzNDdjMGQ1YzdlMzkw
15
+ NWM1OTNiNWJmZTg0ZTEyMmJmNjg0YTZkZjUwYjhjZDVmNTcwMGM=
@@ -1,3 +1,6 @@
1
+ ## v1.3.14
2
+ * configurable table name in resolve/match requests
3
+
1
4
  ## v1.3.13
2
5
  * added support of data/fields parameters of flag
3
6
 
@@ -43,12 +43,22 @@ class Factual
43
43
  Query::Facets.new(@api, "t/#{table_id_or_alias}")
44
44
  end
45
45
 
46
- def match(values)
47
- Query::Match.new(@api, :values => values)
48
- end
49
-
50
- def resolve(values)
51
- Query::Resolve.new(@api, :values => values)
46
+ def match(*args)
47
+ table = 'places'
48
+ values = args[-1]
49
+ if args.first.is_a?(String)
50
+ table = args[0]
51
+ end
52
+ Query::Match.new(@api, table, :values => values)
53
+ end
54
+
55
+ def resolve(*args)
56
+ table = 'places'
57
+ values = args[-1]
58
+ if args.first.is_a?(String)
59
+ table = args[0]
60
+ end
61
+ Query::Resolve.new(@api, table, :values => values)
52
62
  end
53
63
 
54
64
  def geocode(lat, lng)
@@ -1,6 +1,6 @@
1
1
  class Factual
2
2
  class API
3
- VERSION = "1.3.13"
3
+ VERSION = "1.3.14"
4
4
  API_V3_HOST = "api.v3.factual.com"
5
5
  DRIVER_VERSION_TAG = "factual-ruby-driver-v" + VERSION
6
6
  PARAM_ALIASES = { :search => :q, :sort_asc => :sort }
@@ -1,15 +1,16 @@
1
1
  class Factual
2
2
  module Query
3
3
  class Match < Base
4
- def initialize(api, params = {})
5
- @path = "t/places/match"
4
+ def initialize(api, table, params = {})
5
+ @table = table
6
+ @path = "t/#{table}/match"
6
7
  @action = :read
7
8
  super(api, params)
8
9
  end
9
10
 
10
11
  [:values].each do |param|
11
12
  define_method(param) do |*args|
12
- self.class.new(@api, @params.merge(param => form_value(args)))
13
+ self.class.new(@api, @table, @params.merge(param => form_value(args)))
13
14
  end
14
15
  end
15
16
  end
@@ -1,15 +1,16 @@
1
1
  class Factual
2
2
  module Query
3
3
  class Resolve < Base
4
- def initialize(api, params = {})
5
- @path = "t/places/resolve"
4
+ def initialize(api, table, params = {})
5
+ @table = table
6
+ @path = "t/#{@table}/resolve"
6
7
  @action = :read
7
8
  super(api, params)
8
9
  end
9
10
 
10
11
  [:values].each do |param|
11
12
  define_method(param) do |*args|
12
- self.class.new(@api, @params.merge(param => form_value(args)))
13
+ self.class.new(@api, @table, @params.merge(param => form_value(args)))
13
14
  end
14
15
  end
15
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factual-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.13
4
+ version: 1.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rudiger Lippert
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-07 00:00:00.000000000 Z
12
+ date: 2014-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth