signaturit-sdk 0.0.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66f1d1637ac7b7d18378bfbacb4769d08511d269
4
- data.tar.gz: 9d7f84f0d4f7b1691028a62cad5469df34fff2d1
3
+ metadata.gz: 45a1596bab672e72a4712300cecc87413849af29
4
+ data.tar.gz: d5997b95116ba6e29f1cffd3703520c0bdecdf4c
5
5
  SHA512:
6
- metadata.gz: ba7a5e2a4df1ce24fc2e6442fb786e7ab05f101c26e6a20d72d6b5ca01dfa9b6493771ff10ba6e0df13a63390c8d82b46c4aff4d867c1bb289e75500c5a27f2e
7
- data.tar.gz: 899a307d90e475f78493fef6c1843e9028eca0b6ebe7d2f464355b587ded4eabd5cd7e9d98bf2bddf6acfb65d64b62e43033dd611f666a05e3826f980bd02ea5
6
+ metadata.gz: ccf9ef8d66dfac408fd1ddc3cb1328db0f62763d3cf0441af6f4a85553d42e54b4c21e1e4e4eef59e612b6943b4fe3629f18e21250a44634ebaea612d8bb6d84
7
+ data.tar.gz: 64e7058aa229cceb23344d6f47b40a5f984c43d639b0ae9abe503b2af8ca4731f1f42ae55e8a95402cb94ed7e0574224b250f7403b2709645028bb4c445f4fe1
@@ -9,8 +9,9 @@ class SignaturitClient
9
9
 
10
10
  # Initialize the object with the token and environment
11
11
  def initialize(token, production = false)
12
- @token = token
13
- @production = production
12
+ base = production ? 'https://api.signaturit.com' : 'http://api.sandbox.signaturit.com'
13
+
14
+ @client = RestClient::Resource.new base, :headers => { :Authorization => "Bearer #{token}" }, :ssl_version => :TLSv1_2
14
15
  end
15
16
 
16
17
  # get info from your account
@@ -269,17 +270,15 @@ class SignaturitClient
269
270
 
270
271
  # Common request method
271
272
  def request(method, path, params = {}, to_json = true)
272
- base = @production ? 'https://api.signaturit.com' : 'http://api.sandbox.signaturit.com'
273
-
274
273
  case method
275
274
  when :get, :delete
276
275
  encoded = URI.encode_www_form(params)
277
276
  path = "#{path}?#{encoded}" if encoded.length > 0
278
277
 
279
- body = RestClient.send(method, "#{base}#{path}", :Authorization => "Bearer #{@token}")
278
+ body = @client[path].send method
280
279
 
281
280
  else
282
- body = RestClient.send(method, "#{base}#{path}", params, :Authorization => "Bearer #{@token}")
281
+ body = @client[path].send method, params
283
282
  end
284
283
 
285
284
  body = JSON.parse body if to_json
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'signaturit-sdk'
4
- s.version = '0.0.2'
5
- s.date = '2014-09-04'
4
+ s.version = '0.0.3'
5
+ s.date = '2014-10-17'
6
6
  s.summary = 'Signaturit Ruby SDK'
7
7
  s.description = 'Sign Documents Online'
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signaturit-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Signaturit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest_client