contactually 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/contactually.gemspec +2 -2
- data/lib/contactually/version.rb +1 -1
- data/lib/contactually.rb +15 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8707975aafa15dbd19fbda663a7562c8a633f94d
|
4
|
+
data.tar.gz: c1de67c3c986cc9f5136c057e243b874c1b355b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 943faedb5c5ce0b84c730ada77ba7e6d27a5d80e97ebd55d76948c51dea69b1c09851b28e859532d6e930e9254e9a8256340501fd5b3f9e45010c06647cf19e2
|
7
|
+
data.tar.gz: 5f29c612e1c91bc08ac32b986cce94c543015d77e11c59e12c77512bdf3e2d6a3d6fd4f8a627113961dbf8fa8474ebe2feb9a962aa66a438fa52bdabbb1248db
|
data/contactually.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = Contactually::VERSION
|
9
9
|
gem.authors = ["Guille Carlos"]
|
10
10
|
gem.email = ["guille@bitpop.in"]
|
11
|
-
gem.description = %q{
|
12
|
-
gem.summary = %q{
|
11
|
+
gem.description = %q{Write a gem description}
|
12
|
+
gem.summary = %q{Write a gem summary}
|
13
13
|
gem.homepage = ""
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
data/lib/contactually/version.rb
CHANGED
data/lib/contactually.rb
CHANGED
@@ -3,8 +3,19 @@ require "json"
|
|
3
3
|
|
4
4
|
module Contactually
|
5
5
|
class API
|
6
|
-
|
6
|
+
|
7
|
+
def initialize(api_key, headers = {} )
|
7
8
|
@api_key = api_key
|
9
|
+
|
10
|
+
# The Contactually API recommends passing in a User-Agent header unique to
|
11
|
+
# the client application as a best practice
|
12
|
+
# (see: http://developers.contactually.com/docs/):
|
13
|
+
#
|
14
|
+
# Contactually::API.new(
|
15
|
+
# { "YOUR_CONTACTUALLY_API_KEY", :user_agent => "YOUR_APP_NAME" }
|
16
|
+
# )
|
17
|
+
#
|
18
|
+
@headers = headers
|
8
19
|
end
|
9
20
|
|
10
21
|
def call(method, args)
|
@@ -27,6 +38,9 @@ module Contactually
|
|
27
38
|
http_method, contactually_method = get_methods(method)
|
28
39
|
uri = build_uri(contactually_method, args)
|
29
40
|
response = Curl.send(http_method.to_sym, uri, JSON.dump(param_fields(args))) do |curl|
|
41
|
+
@headers.each do |header_name, header_value|
|
42
|
+
curl.headers[header_name.to_s.titleize.gsub(" ", "-")] = header_value
|
43
|
+
end
|
30
44
|
curl.headers['Accept'] = 'application/json'
|
31
45
|
curl.headers['Content-Type'] = 'application/json'
|
32
46
|
end
|
metadata
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contactually
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guille Carlos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: Write a gem description
|
14
14
|
email:
|
15
15
|
- guille@bitpop.in
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
21
21
|
- Gemfile
|
22
22
|
- LICENSE.txt
|
23
23
|
- README.md
|
@@ -36,20 +36,20 @@ require_paths:
|
|
36
36
|
- lib
|
37
37
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
48
48
|
rubyforge_project:
|
49
|
-
rubygems_version: 2.
|
49
|
+
rubygems_version: 2.2.2
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
|
-
summary:
|
52
|
+
summary: Write a gem summary
|
53
53
|
test_files:
|
54
54
|
- test/contactually_test.rb
|
55
55
|
- test/test_helper.rb
|