docusigner 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f4ba241cd3e624d97a3444ae8535160a71a8d7d
4
- data.tar.gz: 3ae9fe3760d8c6ee61833663e2fde646da6289c6
3
+ metadata.gz: b81c0899406059276a3bde8180abecbfa84b3fbc
4
+ data.tar.gz: dadc15a2e03610b23a1c73212c7177f34fc01eeb
5
5
  SHA512:
6
- metadata.gz: b268e71836b42dbcc4c8ea8e83f7cf99a88312e566874a40d4eaff89bc1383e49ebe1efac22e51bec940d04b3bc43605bd71b75c86686c71e7eb2280d394e3d2
7
- data.tar.gz: b461b9e98352b1c587577572fb1a07974db5678db99fae01dd5048b7ca5e2d8856ffab898c2baabd35db9d4816cca2225b8a56b8e2b3f1124564c5a1dc6b4ef7
6
+ metadata.gz: 8ca745a95889268e04b7a4537d91ea3a586c202c3286af816f6c8eef86afef0a197091eccd7844e6494f6330939621ed20b3f4776377c5de17f3e8f64ff2983c
7
+ data.tar.gz: 087e624df28348225535c9c963334504de51486c7c20ba7fcce7b614857a571bb31b13b96224e2c0c794744a2f295d6d76553e4d246acef5639f4f8a1d41353d
data/docusigner.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "docusigner"
3
- s.version = "0.0.6"
3
+ s.version = "0.0.8"
4
4
  s.description = "Unofficial gem for accessing the DocuSign REST API"
5
5
  s.summary = "Unofficial gem for accessing the DocuSign REST API"
6
6
  s.add_dependency "reactive_resource", ">= 0.7.3"
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.author = "Jeff Ching"
13
13
  s.email = "jeff@chingr.com"
14
14
  s.homepage = "http://github.com/chingor13/docusigner"
15
+ s.license = "MIT"
15
16
 
16
17
  s.files = `git ls-files`.split("\n")
17
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
data/lib/docusigner.rb CHANGED
@@ -21,6 +21,7 @@ module Docusigner
21
21
  autoload :Tab, "docusigner/tab"
22
22
  autoload :Template, "docusigner/template"
23
23
  autoload :User, "docusigner/user"
24
+ autoload :UserSettings, "docusigner/user_settings"
24
25
 
25
26
  # other models
26
27
  autoload :Oauth2, "docusigner/oauth2"
@@ -1,9 +1,10 @@
1
1
  require 'reactive_resource'
2
2
  require 'docusigner/multipart'
3
+ require 'docusigner/format'
3
4
  module Docusigner
4
5
  class Base < ReactiveResource::Base
5
6
  self.site = "https://demo.docusign.net/restapi/v2"
6
- self.format = :json
7
+ self.format = Docusigner::Format
7
8
  self.include_root_in_json = false
8
9
 
9
10
  # allow you to attach documents
@@ -40,7 +41,9 @@ module Docusigner
40
41
  old_header = headers.delete('X-DocuSign-Act-As-User')
41
42
  headers['X-DocuSign-Act-As-User'] = user
42
43
  yield
43
- unless old_header.nil?
44
+ if old_header.nil?
45
+ headers.delete('X-DocuSign-Act-As-User')
46
+ else
44
47
  headers['X-DocuSign-Act-As-User'] = old_header
45
48
  end
46
49
  end
@@ -0,0 +1,9 @@
1
+ module Docusigner
2
+ module Format
3
+ extend ActiveResource::Formats::JsonFormat
4
+
5
+ def self.extension
6
+ ""
7
+ end
8
+ end
9
+ end
@@ -2,6 +2,7 @@ module Docusigner
2
2
  class User < Docusigner::Base
3
3
  belongs_to :account
4
4
  has_one :profile
5
+ has_one :settings, :class_name => "Docusigner::UserSettings"
5
6
 
6
7
  # DocuSign does not permit this endpoint
7
8
  def update
@@ -0,0 +1,23 @@
1
+ module Docusigner
2
+ class UserSettings < Docusigner::Base
3
+ belongs_to :user
4
+ singleton
5
+
6
+ self.collection_name = "settings"
7
+ self.element_name = "settings"
8
+
9
+ # the create endpoint requires attributes to be nested under newUsers
10
+ def as_json
11
+ { "userSettings" => user_settings.map(&:as_json) }
12
+ end
13
+
14
+ def load(attributes, remove_root = false)
15
+ super({:user_settings => attributes}, remove_root)
16
+ end
17
+
18
+ def set(key, value)
19
+ user_settings.detect{|us| key == us.name}.value = value
20
+ end
21
+
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docusigner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Ching
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-23 00:00:00.000000000 Z
11
+ date: 2013-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reactive_resource
@@ -88,6 +88,7 @@ files:
88
88
  - lib/docusigner/document.rb
89
89
  - lib/docusigner/envelope.rb
90
90
  - lib/docusigner/folder.rb
91
+ - lib/docusigner/format.rb
91
92
  - lib/docusigner/group.rb
92
93
  - lib/docusigner/login_information.rb
93
94
  - lib/docusigner/multipart.rb
@@ -99,6 +100,7 @@ files:
99
100
  - lib/docusigner/tab.rb
100
101
  - lib/docusigner/template.rb
101
102
  - lib/docusigner/user.rb
103
+ - lib/docusigner/user_settings.rb
102
104
  - test/test.pdf
103
105
  - test/test_helper.rb
104
106
  - test/unit/account_test.rb
@@ -108,7 +110,8 @@ files:
108
110
  - test/unit/oauth_test.rb
109
111
  - test/unit/user_test.rb
110
112
  homepage: http://github.com/chingor13/docusigner
111
- licenses: []
113
+ licenses:
114
+ - MIT
112
115
  metadata: {}
113
116
  post_install_message:
114
117
  rdoc_options: []