clicksign 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -4
- data/README.md +8 -0
- data/lib/clicksign/document.rb +6 -0
- data/lib/clicksign/version.rb +1 -1
- data/spec/clicksign_spec.rb +13 -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: ba8a6fd5745d42f05bf0c453700eb54cf43ba44c
|
4
|
+
data.tar.gz: 37df59e1366aeca62d5ace804082da84489873f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4815936d29cbe919cad343cce5bd3b62dc14e645b7549cd9a81ca1f8a37b28276208f6c20f03e28eea4a91c746e27d0543299a78efc5b87e94c4b39e41e9ac8
|
7
|
+
data.tar.gz: 6b50aa03b39506b9174f551af82676e74a4a1eb53c2a7f9525fd254a646364263861de5f55f147b399a24d6fa384bc413fd1147611e5da390fc447ea59c3cd1d
|
data/Gemfile.lock
CHANGED
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.
|
data/lib/clicksign/document.rb
CHANGED
@@ -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
|
data/lib/clicksign/version.rb
CHANGED
data/spec/clicksign_spec.rb
CHANGED
@@ -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
|
+
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-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|