rapleaf_api 1.2.3.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/rapleaf_api.rb +16 -0
- data/rapleaf_api.gemspec +3 -3
- metadata +9 -8
data/README.md
CHANGED
@@ -14,7 +14,7 @@ Usage
|
|
14
14
|
> api = RapleafApi::Api.new('my secret API key')
|
15
15
|
=> #<RapleafApi::Api:0x101b7f5f0 @API_KEY="my secret API key", @CA_FILE=nil, @TIMEOUT=2, @BASE_PATH="/v4/dr?api_key=my secret API key">
|
16
16
|
> h = api.query_by_email('test@rapleaf.com')
|
17
|
-
=> {"
|
17
|
+
=> {"gender"=>"Male", "age"=>"25-34"}
|
18
18
|
|
19
19
|
Constructor Options
|
20
20
|
-------------------
|
data/lib/rapleaf_api.rb
CHANGED
@@ -31,6 +31,7 @@ module RapleafApi
|
|
31
31
|
@API_KEY = api_key
|
32
32
|
@BASE_PATH = "/v4/dr?api_key=#{@API_KEY}"
|
33
33
|
@BULK_PATH = "/v4/bulk?api_key=#{@API_KEY}"
|
34
|
+
@UTIL_PATH = "/v4/util"
|
34
35
|
@TIMEOUT = options[:timeout] || 2
|
35
36
|
@BULK_TIMEOUT = options[:bulk_timeout] || 30
|
36
37
|
@CA_FILE = options[:ca_file] # set to your system-wide root ca cert file
|
@@ -99,6 +100,21 @@ module RapleafApi
|
|
99
100
|
get_json_response(url, options[:show_available])
|
100
101
|
end
|
101
102
|
|
103
|
+
# Takes a name and returns a hash which maps attribute fields onto attributes
|
104
|
+
def util_name_to_gender(name)
|
105
|
+
get_json_response("#{@UTIL_PATH}/name_to_gender/#{url_encode(name.strip)}?api_key=#{@API_KEY}")
|
106
|
+
end
|
107
|
+
|
108
|
+
# Takes an e-mail or username and returns a hash which maps attribute fields onto attributes
|
109
|
+
def util_name_deducer(email_or_username)
|
110
|
+
get_json_response("#{@UTIL_PATH}/name_deducer/#{url_encode(email_or_username.strip)}?api_key=#{@API_KEY}")
|
111
|
+
end
|
112
|
+
|
113
|
+
# Takes a name and returns a hash which maps attribute fields onto attributes
|
114
|
+
def util_name_normalizer(name)
|
115
|
+
get_json_response("#{@UTIL_PATH}/name_normalizer/#{url_encode(name.strip)}?api_key=#{@API_KEY}")
|
116
|
+
end
|
117
|
+
|
102
118
|
def bulk_query(set, show_available = false)
|
103
119
|
path = @BULK_PATH
|
104
120
|
path += "&show_available=true" if show_available
|
data/rapleaf_api.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rapleaf_api}
|
5
|
-
s.version = "1.2.
|
5
|
+
s.version = "1.2.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Rapleaf"]
|
9
|
-
s.date = %q{
|
10
|
-
s.description = %q{A library for interacting with Rapleaf's Personalization
|
9
|
+
s.date = %q{2012-04-30}
|
10
|
+
s.description = %q{A library for interacting with Rapleaf's Personalization and Utilities APIs.}
|
11
11
|
s.email = %q{developer @nospam@ rapleaf.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "lib/rapleaf_api.rb"]
|
13
13
|
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.md", "Rakefile", "lib/rapleaf_api.rb", "rapleaf_api.gemspec"]
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapleaf_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 1.2.3.3
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Rapleaf
|
@@ -16,7 +15,8 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date:
|
18
|
+
date: 2012-04-30 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: json
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: "0"
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id002
|
49
|
-
description: A library for interacting with Rapleaf's Personalization
|
49
|
+
description: A library for interacting with Rapleaf's Personalization and Utilities APIs.
|
50
50
|
email: developer @nospam@ rapleaf.com
|
51
51
|
executables: []
|
52
52
|
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- Rakefile
|
66
66
|
- lib/rapleaf_api.rb
|
67
67
|
- rapleaf_api.gemspec
|
68
|
+
has_rdoc: true
|
68
69
|
homepage: http://www.rapleaf.com
|
69
70
|
licenses: []
|
70
71
|
|
@@ -100,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
101
|
requirements: []
|
101
102
|
|
102
103
|
rubyforge_project: rapleaf_api
|
103
|
-
rubygems_version: 1.
|
104
|
+
rubygems_version: 1.3.7
|
104
105
|
signing_key:
|
105
106
|
specification_version: 3
|
106
107
|
summary: A library for interacting with Rapleaf's Personalization API.
|