contactually-api 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contactually/api.rb +3 -3
- data/lib/contactually/version.rb +1 -1
- data/spec/api_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd7a2066d2e464a598894a236dd4fc7e640fd8c
|
4
|
+
data.tar.gz: 54231ef13bfc48b4ca4f05a43839efc4e04bb39c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 721a6a77ee10988644909cf9f917e40be57d1d535785cd01becc3dfe9426cdf0caea3eb62e47f9bf5468507ff1ab4941c2de761f1f3672c9e2b065f969318b4a
|
7
|
+
data.tar.gz: 3501748db20d7c4742549dfd60187047f1e83ae1dd6ba6039823e69b0fca76dd0d8e1560dfac31d332a16dbbec1b42366b9a4635d13991e461a14b305fb39f13
|
data/lib/contactually/api.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Contactually
|
2
2
|
class API
|
3
|
-
def initialize
|
4
|
-
raise ConfigMissingApiKeyError, 'You must provide a Contactually API key' unless Contactually.config.api_key
|
5
|
-
@api_key = Contactually.config.api_key
|
3
|
+
def initialize(api_key = nil)
|
4
|
+
raise ConfigMissingApiKeyError, 'You must provide a Contactually API key' unless Contactually.config.api_key || api_key
|
5
|
+
@api_key = Contactually.config.api_key || api_key
|
6
6
|
@base_url = Contactually.config.contactually_url
|
7
7
|
end
|
8
8
|
|
data/lib/contactually/version.rb
CHANGED
data/spec/api_spec.rb
CHANGED
@@ -7,6 +7,14 @@ describe Contactually::API do
|
|
7
7
|
specify do
|
8
8
|
expect{ subject }.to raise_error Contactually::ConfigMissingApiKeyError
|
9
9
|
end
|
10
|
+
|
11
|
+
it 'allows to supply api key via initialize' do
|
12
|
+
expect{ described_class.new('asdf') }.not_to raise_error
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'sets api_key from parameters' do
|
16
|
+
expect(described_class.new('asdf').instance_variable_get(:@api_key)).to eq 'asdf'
|
17
|
+
end
|
10
18
|
end
|
11
19
|
|
12
20
|
describe 'valid configuration' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contactually-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Heck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|