clicksign 0.1.4 → 0.1.5

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: e190617a8165a91dfe5eafc285aec246b819fd45
4
- data.tar.gz: 980736375f64d975e8e6508325dbe5629df3dc9c
3
+ metadata.gz: ba8a6fd5745d42f05bf0c453700eb54cf43ba44c
4
+ data.tar.gz: 37df59e1366aeca62d5ace804082da84489873f6
5
5
  SHA512:
6
- metadata.gz: 96acab5e66d16ccfb666ca32b440071830177968ec1113801217a138df00a399891625766efd04de46dc8cf80fca3430ff6d37b0b9c287142d28471da3f579a2
7
- data.tar.gz: efab1f4d40647233ad0119ff84d9ba9888c6f4e2fb0577cf597aac3cf432f119df200ac10ecefc4f9bb94600255d981f85c181930de8437f8539783e4f0dd63d
6
+ metadata.gz: f4815936d29cbe919cad343cce5bd3b62dc14e645b7549cd9a81ca1f8a37b28276208f6c20f03e28eea4a91c746e27d0543299a78efc5b87e94c4b39e41e9ac8
7
+ data.tar.gz: 6b50aa03b39506b9174f551af82676e74a4a1eb53c2a7f9525fd254a646364263861de5f55f147b399a24d6fa384bc413fd1147611e5da390fc447ea59c3cd1d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clicksign (0.1.4)
4
+ clicksign (0.1.5)
5
5
  rest-client
6
6
 
7
7
  GEM
@@ -43,6 +43,3 @@ DEPENDENCIES
43
43
  clicksign!
44
44
  rake
45
45
  rspec (~> 3.0)
46
-
47
- BUNDLED WITH
48
- 1.10.6
data/README.md CHANGED
@@ -103,6 +103,14 @@ messsage = 'This is a reminder for you to sign the document.'
103
103
  Clicksign::Document.resend(key, email, message)
104
104
  ```
105
105
 
106
+ ### Canceling a document
107
+
108
+ ```ruby
109
+ doc = Clicksign::Document.cancel(document_key)
110
+ ```
111
+
112
+ The method returns the canceled document.
113
+
106
114
  ### Hooks
107
115
 
108
116
  You can perform three different actions with hooks: **retrieve** all, **create** a new one or **delete** an existing hook.
@@ -36,6 +36,12 @@ module Clicksign
36
36
  content_type: 'json'
37
37
  end
38
38
 
39
+ def self.cancel(key)
40
+ request :post,
41
+ api_url('documents', key, 'cancel'),
42
+ {}.to_json, content_type: 'json'
43
+ end
44
+
39
45
  def self.download(key)
40
46
  RestClient.get(api_url('documents', key, 'download')) do |response, request, result, &block|
41
47
  case response.code
@@ -1,3 +1,3 @@
1
1
  module Clicksign
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
@@ -71,6 +71,19 @@ describe Clicksign::Document do
71
71
  end
72
72
  end
73
73
 
74
+ describe '.cancel' do
75
+ it 'cancels document' do
76
+ key = "1123-4567-89ab-cdef"
77
+
78
+ expect(RestClient).to receive(:post)
79
+ .with(
80
+ "http://example.com/v1/documents/#{key}/cancel?access_token=my_token",
81
+ {}.to_json, { content_type: 'json', accept: 'json' }).and_return({})
82
+
83
+ Clicksign::Document.cancel(key)
84
+ end
85
+ end
86
+
74
87
  describe '.download' do
75
88
  it 'downloads document' do
76
89
  key = "1123-4567-89ab-cdef"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clicksign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clicksign
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client