From e1118b777792f163e52fdb86c00b42b9d663bb14 Mon Sep 17 00:00:00 2001 From: Jen Young Date: Thu, 16 Aug 2018 09:40:20 -0700 Subject: [PATCH 1/3] Add fix to Get Files endpoint to return file --- lib/hello_sign/api/signature_request.rb | 2 +- lib/hello_sign/resource/resource_array.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/hello_sign/api/signature_request.rb b/lib/hello_sign/api/signature_request.rb index 570dcf0..ebe227d 100644 --- a/lib/hello_sign/api/signature_request.rb +++ b/lib/hello_sign/api/signature_request.rb @@ -313,7 +313,7 @@ def signature_request_files(opts) separator = opts[:file_type].nil? ? '?' : '&' path = path + "#{separator}get_url=#{opts[:get_url]}" end - get(path) + get(path)[:body] end # diff --git a/lib/hello_sign/resource/resource_array.rb b/lib/hello_sign/resource/resource_array.rb index 320540e..03af698 100644 --- a/lib/hello_sign/resource/resource_array.rb +++ b/lib/hello_sign/resource/resource_array.rb @@ -30,7 +30,7 @@ module Resource # @author [hellosign] # class ResourceArray < Array - attr_reader :page, :num_pages, :num_results, :page_size, :warnings, :headers, :list_info + attr_reader :page, :num_pages, :num_results, :page_size, :warnings, :headers, :list_info, :data # # create a new ResourceArray from a hash # @@ -41,6 +41,7 @@ class ResourceArray < Array # @return [type] [description] def initialize(hash, key, resource_class) @headers = hash[:headers] + @data = hash[:body] @list_info = hash[:body]['list_info'] @page = @list_info['page'] @num_pages = @list_info['num_pages'] @@ -50,7 +51,7 @@ def initialize(hash, key, resource_class) self << resource_class.new(hash[:body], nil) hash[key] && hash[key].each do |resource| - self << resource_class.new(resource, nil) + self << resource_class.new(resource, nil).raw_data end end end From 5e77784e41772a24c6bb62acf954723eeadfc00e Mon Sep 17 00:00:00 2001 From: Jen Young Date: Thu, 16 Aug 2018 12:14:19 -0700 Subject: [PATCH 2/3] Version bump to 3.7.1 --- lib/hello_sign/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hello_sign/version.rb b/lib/hello_sign/version.rb index 09e708a..6bf5489 100644 --- a/lib/hello_sign/version.rb +++ b/lib/hello_sign/version.rb @@ -23,5 +23,5 @@ # module HelloSign - VERSION = '3.7.1' + VERSION = '3.7.2' end From 9a734ac9599c71b55b9b0a48e9565b7988797a15 Mon Sep 17 00:00:00 2001 From: Jen Young Date: Thu, 16 Aug 2018 12:16:48 -0700 Subject: [PATCH 3/3] Remove redundancy in ResourceArray --- lib/hello_sign/resource/resource_array.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hello_sign/resource/resource_array.rb b/lib/hello_sign/resource/resource_array.rb index 03af698..de38ee2 100644 --- a/lib/hello_sign/resource/resource_array.rb +++ b/lib/hello_sign/resource/resource_array.rb @@ -51,7 +51,7 @@ def initialize(hash, key, resource_class) self << resource_class.new(hash[:body], nil) hash[key] && hash[key].each do |resource| - self << resource_class.new(resource, nil).raw_data + self << resource_class.new(resource, nil) end end end