groupdocs 1.2.11 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/.travis.yml +2 -0
  2. data/Gemfile +1 -1
  3. data/README.md +0 -2
  4. data/Rakefile +1 -1
  5. data/examples/api-samples/Gemfile +1 -1
  6. data/examples/api-samples/samples/annotation-sample.rb +50 -0
  7. data/examples/api-samples/samples/sample18.rb +11 -2
  8. data/examples/api-samples/samples/sample19.rb +58 -0
  9. data/examples/api-samples/samples/sample20.rb +50 -0
  10. data/examples/api-samples/samples/sample21.rb +65 -0
  11. data/examples/api-samples/samples/sample22.rb +52 -0
  12. data/examples/api-samples/views/annotation_sample.haml +64 -0
  13. data/examples/api-samples/views/index.haml +8 -0
  14. data/examples/api-samples/views/sample1.haml +9 -1
  15. data/examples/api-samples/views/sample10.haml +9 -1
  16. data/examples/api-samples/views/sample11.haml +10 -0
  17. data/examples/api-samples/views/sample12.haml +8 -0
  18. data/examples/api-samples/views/sample13.haml +8 -0
  19. data/examples/api-samples/views/sample14.haml +8 -0
  20. data/examples/api-samples/views/sample15.haml +8 -0
  21. data/examples/api-samples/views/sample16.haml +8 -0
  22. data/examples/api-samples/views/sample17.haml +8 -0
  23. data/examples/api-samples/views/sample18.haml +11 -0
  24. data/examples/api-samples/views/sample19.haml +102 -0
  25. data/examples/api-samples/views/sample2.haml +9 -1
  26. data/examples/api-samples/views/sample20.haml +89 -0
  27. data/examples/api-samples/views/sample21.haml +106 -0
  28. data/examples/api-samples/views/sample22.haml +107 -0
  29. data/examples/api-samples/views/sample3.haml +10 -2
  30. data/examples/api-samples/views/sample4.haml +8 -0
  31. data/examples/api-samples/views/sample5.haml +8 -0
  32. data/examples/api-samples/views/sample6.haml +8 -0
  33. data/examples/api-samples/views/sample7.haml +9 -1
  34. data/examples/api-samples/views/sample8.haml +10 -2
  35. data/examples/api-samples/views/sample9.haml +10 -2
  36. data/groupdocs.gemspec +4 -3
  37. data/lib/groupdocs.rb +2 -4
  38. data/lib/groupdocs/api.rb +2 -0
  39. data/lib/groupdocs/api/entity.rb +4 -36
  40. data/lib/groupdocs/api/helpers/access_rights_helper.rb +4 -4
  41. data/lib/groupdocs/api/helpers/byte_flag_helper.rb +3 -3
  42. data/lib/groupdocs/api/helpers/rest_helper.rb +5 -5
  43. data/lib/groupdocs/api/helpers/status_helper.rb +2 -2
  44. data/lib/groupdocs/api/helpers/url_helper.rb +2 -2
  45. data/lib/groupdocs/document.rb +55 -24
  46. data/lib/groupdocs/document/annotation.rb +7 -7
  47. data/lib/groupdocs/document/annotation/reply.rb +2 -2
  48. data/lib/groupdocs/document/view.rb +1 -1
  49. data/lib/groupdocs/job.rb +20 -20
  50. data/lib/groupdocs/questionnaire.rb +2 -2
  51. data/lib/groupdocs/questionnaire/collector.rb +2 -2
  52. data/lib/groupdocs/questionnaire/execution.rb +1 -1
  53. data/lib/groupdocs/questionnaire/question.rb +2 -2
  54. data/lib/groupdocs/signature.rb +1 -1
  55. data/lib/groupdocs/signature/envelope.rb +19 -19
  56. data/lib/groupdocs/signature/field.rb +6 -6
  57. data/lib/groupdocs/signature/form.rb +7 -7
  58. data/lib/groupdocs/signature/list.rb +2 -2
  59. data/lib/groupdocs/signature/recipient.rb +6 -6
  60. data/lib/groupdocs/signature/shared/document_methods.rb +5 -5
  61. data/lib/groupdocs/signature/shared/entity_methods.rb +4 -4
  62. data/lib/groupdocs/signature/shared/field_methods.rb +8 -8
  63. data/lib/groupdocs/signature/shared/recipient_methods.rb +2 -2
  64. data/lib/groupdocs/signature/shared/resource_methods.rb +1 -1
  65. data/lib/groupdocs/signature/template.rb +4 -4
  66. data/lib/groupdocs/storage.rb +4 -4
  67. data/lib/groupdocs/storage/file.rb +4 -4
  68. data/lib/groupdocs/storage/folder.rb +4 -4
  69. data/lib/groupdocs/subscription.rb +15 -15
  70. data/lib/groupdocs/version.rb +1 -1
  71. data/spec/groupdocs/api/entity_spec.rb +10 -37
  72. data/spec/groupdocs/api/helpers/access_mode_helper_spec.rb +1 -1
  73. data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +3 -3
  74. data/spec/groupdocs/api/helpers/credentials_helpers_spec.rb +5 -5
  75. data/spec/groupdocs/api/helpers/rest_helper_spec.rb +15 -15
  76. data/spec/groupdocs/api/helpers/status_helper_spec.rb +1 -1
  77. data/spec/groupdocs/api/helpers/url_helper_spec.rb +11 -11
  78. data/spec/groupdocs/api/request_spec.rb +6 -6
  79. data/spec/groupdocs/datasource_spec.rb +9 -9
  80. data/spec/groupdocs/document/annotation/reply_spec.rb +15 -15
  81. data/spec/groupdocs/document/annotation/reviewer_spec.rb +3 -3
  82. data/spec/groupdocs/document/annotation_spec.rb +17 -17
  83. data/spec/groupdocs/document/change_spec.rb +1 -1
  84. data/spec/groupdocs/document/field_spec.rb +1 -1
  85. data/spec/groupdocs/document/metadata_spec.rb +3 -3
  86. data/spec/groupdocs/document/view_spec.rb +4 -4
  87. data/spec/groupdocs/document_spec.rb +92 -66
  88. data/spec/groupdocs/job_spec.rb +29 -29
  89. data/spec/groupdocs/questionnaire/collector_spec.rb +15 -19
  90. data/spec/groupdocs/questionnaire/execution_spec.rb +12 -12
  91. data/spec/groupdocs/questionnaire/page_spec.rb +4 -4
  92. data/spec/groupdocs/questionnaire/question_spec.rb +6 -6
  93. data/spec/groupdocs/questionnaire_spec.rb +18 -18
  94. data/spec/groupdocs/signature/contact_spec.rb +9 -9
  95. data/spec/groupdocs/signature/envelope_spec.rb +34 -34
  96. data/spec/groupdocs/signature/field_spec.rb +13 -13
  97. data/spec/groupdocs/signature/form_spec.rb +9 -9
  98. data/spec/groupdocs/signature/list_spec.rb +3 -3
  99. data/spec/groupdocs/signature/role_spec.rb +2 -2
  100. data/spec/groupdocs/signature/template_spec.rb +6 -6
  101. data/spec/groupdocs/signature_spec.rb +3 -3
  102. data/spec/groupdocs/storage/file_spec.rb +20 -20
  103. data/spec/groupdocs/storage/folder_spec.rb +21 -21
  104. data/spec/groupdocs/storage/package_spec.rb +2 -2
  105. data/spec/groupdocs/storage_spec.rb +1 -1
  106. data/spec/groupdocs/subscription_spec.rb +3 -3
  107. data/spec/groupdocs/user_spec.rb +5 -5
  108. data/spec/spec_helper.rb +9 -7
  109. data/spec/support/json/document_thumbnails.json +24 -0
  110. data/spec/support/shared_examples/api/entity.rb +8 -8
  111. data/spec/support/shared_examples/signature/shared/document_methods.rb +8 -8
  112. data/spec/support/shared_examples/signature/shared/entity_fields.rb +3 -3
  113. data/spec/support/shared_examples/signature/shared/entity_methods.rb +12 -12
  114. data/spec/support/shared_examples/signature/shared/field_methods.rb +29 -29
  115. data/spec/support/shared_examples/signature/shared/recipient_methods.rb +3 -3
  116. data/spec/support/shared_examples/signature/shared/resource_methods.rb +2 -2
  117. metadata +33 -5
@@ -14,7 +14,7 @@ module GroupDocs
14
14
  #
15
15
  def add_params(params)
16
16
  params.each do |param, value|
17
- value = value.join(?,) if value.is_a?(Array)
17
+ value = value.join(',') if value.is_a?(Array)
18
18
  options[:path] << "#{separator}#{param}=#{value}"
19
19
  end
20
20
  end
@@ -46,7 +46,7 @@ module GroupDocs
46
46
  #
47
47
  def url_encode_path
48
48
  options[:path] = URI.escape(options[:path])
49
- options[:path].gsub! ?+, '%2B'
49
+ options[:path].gsub! '+', '%2B'
50
50
  end
51
51
 
52
52
  #
@@ -9,10 +9,10 @@ module GroupDocs
9
9
  require 'groupdocs/document/view'
10
10
 
11
11
  ACCESS_MODES = {
12
- private: 0,
13
- restricted: 1,
14
- inherited: 2,
15
- public: 3,
12
+ :private => 0,
13
+ :restricted => 1,
14
+ :inherited => 2,
15
+ :public => 3,
16
16
  }
17
17
 
18
18
  include Api::Helpers::AccessMode
@@ -61,7 +61,7 @@ module GroupDocs
61
61
  end.execute!
62
62
 
63
63
  json[:templates].map do |template|
64
- template.merge!(file: Storage::File.new(template))
64
+ template.merge!(:file => Storage::File.new(template))
65
65
  Document.new(template)
66
66
  end
67
67
  end
@@ -104,10 +104,10 @@ module GroupDocs
104
104
 
105
105
  documents_to_sign = []
106
106
  documents.map(&:file).each do |file|
107
- document = { name: file.name }
107
+ document = { :name => file.name }
108
108
  contents = File.read(file.local_path)
109
109
  contents = Base64.strict_encode64(contents)
110
- document.merge!(data: "data:#{mime_type(file.local_path)};base64,#{contents}")
110
+ document.merge!(:data => "data:#{mime_type(file.local_path)};base64,#{contents}")
111
111
 
112
112
  documents_to_sign << document
113
113
  end
@@ -116,10 +116,10 @@ module GroupDocs
116
116
  signatures.each do |signature|
117
117
  contents = File.read(signature.image_path)
118
118
  contents = Base64.strict_encode64(contents)
119
- signer = { name: signature.name, data: "data:#{mime_type(signature.image_path)};base64,#{contents}" }
119
+ signer = { :name => signature.name, :data => "data:#{mime_type(signature.image_path)};base64,#{contents}" }
120
120
  signer.merge!(signature.position)
121
121
  # place signature on is not implemented yet
122
- signer.merge!(placeSignatureOn: nil)
122
+ signer.merge!(:placeSignatureOn => nil)
123
123
 
124
124
  signers << signer
125
125
  end
@@ -128,13 +128,13 @@ module GroupDocs
128
128
  request[:access] = access
129
129
  request[:method] = :POST
130
130
  request[:path] = '/signature/{{client_id}}/sign'
131
- request[:request_body] = { documents: documents_to_sign, signers: signers }
131
+ request[:request_body] = { :documents => documents_to_sign, :signers => signers }
132
132
  end.execute!
133
133
 
134
134
  signed_documents = []
135
135
  json[:documents].each_with_index do |document, i|
136
- file = Storage::File.new(guid: document[:documentId], name: "#{documents[i].file.name}_signed.pdf")
137
- signed_documents << Document.new(file: file)
136
+ file = Storage::File.new(:guid => document[:documentId], :name => "#{documents[i].file.name}_signed.pdf")
137
+ signed_documents << Document.new(:file => file)
138
138
  end
139
139
 
140
140
  signed_documents
@@ -163,7 +163,7 @@ module GroupDocs
163
163
  metadata.views_count = json[:views_count]
164
164
  if json[:last_view]
165
165
  metadata.last_view = json[:last_view]
166
- metadata.last_view.document = new(file: Storage::File.new(json))
166
+ metadata.last_view.document = new(:file => Storage::File.new(json))
167
167
  end
168
168
  end
169
169
  end
@@ -202,7 +202,7 @@ module GroupDocs
202
202
  # @return [Array<Symbol>]
203
203
  #
204
204
  def output_formats
205
- @output_formats.split(?,).map(&:to_sym)
205
+ @output_formats.split(',').map(&:to_sym)
206
206
  end
207
207
 
208
208
  #
@@ -273,6 +273,37 @@ module GroupDocs
273
273
  json[:url]
274
274
  end
275
275
 
276
+ #
277
+ # Returns array of URLs to images representing document pages thumbnails.
278
+ #
279
+ # @example
280
+ # file = GroupDocs::Storage::Folder.list!.last
281
+ # document = file.to_document
282
+ # document.thumbnails! first_page: 0, page_count: 1, width: 1024
283
+ #
284
+ # @param [Hash] options
285
+ # @option options [Integer] :page_number Start page to return image for (starting with 0)
286
+ # @option options [Integer] :page_count Number of pages to return image for
287
+ # @option options [Integer] :width
288
+ # @option options [Integer] :quality
289
+ # @option options [Boolean] :use_pdf
290
+ # @param [Hash] access Access credentials
291
+ # @option access [String] :client_id
292
+ # @option access [String] :private_key
293
+ # @return [Array<String>]
294
+ #
295
+ def thumbnails!(options = {}, access = {})
296
+ api = Api::Request.new do |request|
297
+ request[:access] = access
298
+ request[:method] = :POST
299
+ request[:path] = "/doc/{{client_id}}/files/#{file.guid}/thumbnails"
300
+ end
301
+ api.add_params(options)
302
+ json = api.execute!
303
+
304
+ json[:image_urls]
305
+ end
306
+
276
307
  #
277
308
  # Returns access mode of document.
278
309
  #
@@ -306,7 +337,7 @@ module GroupDocs
306
337
  request[:method] = :PUT
307
338
  request[:path] = "/doc/{{client_id}}/files/#{file.id}/accessinfo"
308
339
  end
309
- api.add_params(mode: ACCESS_MODES[mode])
340
+ api.add_params(:mode => ACCESS_MODES[mode])
310
341
  json = api.execute!
311
342
 
312
343
  parse_access_mode(json[:access])
@@ -375,7 +406,7 @@ module GroupDocs
375
406
  request[:method] = :GET
376
407
  request[:path] = "/doc/{{client_id}}/files/#{file.guid}/fields"
377
408
  end
378
- api.add_params(include_geometry: true)
409
+ api.add_params(:include_geometry => true)
379
410
  json = api.execute!
380
411
 
381
412
  json[:fields].map do |field|
@@ -467,7 +498,7 @@ module GroupDocs
467
498
  # @return [GroupDocs::Job] Created job
468
499
  #
469
500
  def convert!(format, options = {}, access = {})
470
- options.merge!(new_type: format)
501
+ options.merge!(:new_type => format)
471
502
 
472
503
  api = Api::Request.new do |request|
473
504
  request[:access] = access
@@ -477,7 +508,7 @@ module GroupDocs
477
508
  api.add_params(options)
478
509
  json = api.execute!
479
510
 
480
- Job.new(id: json[:job_id])
511
+ Job.new(:id => json[:job_id])
481
512
  end
482
513
 
483
514
  #
@@ -506,7 +537,7 @@ module GroupDocs
506
537
  api.add_params(options)
507
538
  json = api.execute!
508
539
 
509
- Job.new(id: json[:job_id])
540
+ Job.new(:id => json[:job_id])
510
541
  end
511
542
 
512
543
  #
@@ -614,7 +645,7 @@ module GroupDocs
614
645
 
615
646
  if json[:annotations]
616
647
  json[:annotations].map do |annotation|
617
- annotation.merge!(document: self)
648
+ annotation.merge!(:document => self)
618
649
  Document::Annotation.new(annotation)
619
650
  end
620
651
  else
@@ -636,7 +667,7 @@ module GroupDocs
636
667
  request[:method] = :GET
637
668
  request[:path] = "/comparison/{{client_id}}/comparison/document"
638
669
  end
639
- api.add_params(guid: file.guid)
670
+ api.add_params(:guid => file.guid)
640
671
  api.execute!
641
672
  end
642
673
 
@@ -660,10 +691,10 @@ module GroupDocs
660
691
  request[:method] = :GET
661
692
  request[:path] = "/comparison/{{client_id}}/comparison/compare"
662
693
  end
663
- api.add_params(source: file.guid, target: document.file.guid)
694
+ api.add_params(:source => file.guid, :target => document.file.guid)
664
695
  json = api.execute!
665
696
 
666
- Job.new(id: json[:job_id])
697
+ Job.new(:id => json[:job_id])
667
698
  end
668
699
 
669
700
  #
@@ -687,7 +718,7 @@ module GroupDocs
687
718
  request[:method] = :GET
688
719
  request[:path] = "/comparison/{{client_id}}/comparison/changes"
689
720
  end
690
- api.add_params(resultFileId: file.guid)
721
+ api.add_params(:resultFileId => file.guid)
691
722
  json = api.execute!
692
723
 
693
724
  json[:changes].map do |change|
@@ -66,7 +66,7 @@ module GroupDocs
66
66
  #
67
67
  def type=(type)
68
68
  if type.is_a?(Symbol)
69
- type = accessor_to_variable(type).to_s.delete(?@)
69
+ type = type.to_s.camelize
70
70
  TYPES.include?(type) or raise ArgumentError, "Unknown type: #{type.inspect}"
71
71
  end
72
72
 
@@ -79,7 +79,7 @@ module GroupDocs
79
79
  # @return [Symbol]
80
80
  #
81
81
  def type
82
- variable_to_accessor(@type)
82
+ @type.underscore.to_sym
83
83
  end
84
84
 
85
85
  #
@@ -130,7 +130,7 @@ module GroupDocs
130
130
  if reply.is_a?(GroupDocs::Document::Annotation::Reply)
131
131
  reply
132
132
  else
133
- reply.merge!(annotation: self)
133
+ reply.merge!(:annotation => self)
134
134
  Document::Annotation::Reply.new(reply)
135
135
  end
136
136
  end
@@ -221,10 +221,10 @@ module GroupDocs
221
221
  request[:access] = access
222
222
  request[:method] = :PUT
223
223
  request[:path] = "/ant/{{client_id}}/annotations/#{guid}/position"
224
- request[:request_body] = { x: x, y: y }
224
+ request[:request_body] = { :x => x, :y => y }
225
225
  end.execute!
226
226
 
227
- self.annotation_position = { x: x, y: y }
227
+ self.annotation_position = { :x => x, :y => y }
228
228
  end
229
229
 
230
230
  #
@@ -241,14 +241,14 @@ module GroupDocs
241
241
  request[:access] = access
242
242
  request[:method] = :PUT
243
243
  request[:path] = "/ant/{{client_id}}/annotations/#{guid}/markerPosition"
244
- request[:request_body] = { x: x, y: y }
244
+ request[:request_body] = { :x => x, :y => y }
245
245
  end.execute!
246
246
 
247
247
  if box
248
248
  box.x = x
249
249
  box.y = y
250
250
  else
251
- self.box = { x: x, y: y }
251
+ self.box = { :x => x, :y => y }
252
252
  end
253
253
  end
254
254
 
@@ -32,7 +32,7 @@ module GroupDocs
32
32
  json = api.execute!
33
33
 
34
34
  json[:replies].map do |reply|
35
- reply.merge!(annotation: annotation)
35
+ reply.merge!(:annotation => annotation)
36
36
  Document::Annotation::Reply.new(reply)
37
37
  end
38
38
  end
@@ -99,7 +99,7 @@ module GroupDocs
99
99
  request[:access] = access
100
100
  request[:method] = :POST
101
101
  request[:path] = "/ant/{{client_id}}/annotations/#{get_annotation_guid}/replies"
102
- request[:request_body] = { text: text }
102
+ request[:request_body] = { :text => text }
103
103
  end.execute!
104
104
 
105
105
  self.guid = json[:replyGuid]
@@ -27,7 +27,7 @@ module GroupDocs
27
27
  if object.is_a?(GroupDocs::Document)
28
28
  @document = object
29
29
  else
30
- object.merge!(file: GroupDocs::Storage::File.new(object))
30
+ object.merge!(:file => GroupDocs::Storage::File.new(object))
31
31
  @document = GroupDocs::Document.new(object)
32
32
  end
33
33
  end
@@ -2,17 +2,17 @@ module GroupDocs
2
2
  class Job < Api::Entity
3
3
 
4
4
  ACTIONS = {
5
- none: 0,
6
- convert: 1,
7
- combine: 2,
8
- compress_zip: 4,
9
- compress_rar: 8,
10
- trace: 16,
11
- convert_body: 32,
12
- bind_data: 64,
13
- print: 128,
14
- compare: 256,
15
- import_annotations: 512,
5
+ :none => 0,
6
+ :convert => 1,
7
+ :combine => 2,
8
+ :compress_zip => 4,
9
+ :compress_rar => 8,
10
+ :trace => 16,
11
+ :convert_body => 32,
12
+ :bind_data => 64,
13
+ :print => 128,
14
+ :compare => 256,
15
+ :import_annotations => 512,
16
16
  }
17
17
 
18
18
  extend Api::Helpers::ByteFlag
@@ -58,7 +58,7 @@ module GroupDocs
58
58
  request[:method] = :GET
59
59
  request[:path] = "/async/{{client_id}}/jobs/#{id}"
60
60
  end
61
- api.add_params(format: 'json')
61
+ api.add_params(:format => 'json')
62
62
  json = api.execute!
63
63
 
64
64
  Job.new(json)
@@ -90,7 +90,7 @@ module GroupDocs
90
90
  end
91
91
  json = api.execute!
92
92
 
93
- Job.new(id: json[:job_id], guid: json[:job_guid])
93
+ Job.new(:id => json[:job_id], :guid => json[:job_guid])
94
94
  end
95
95
 
96
96
  # @attr [Integer] id
@@ -122,7 +122,7 @@ module GroupDocs
122
122
  def documents=(documents)
123
123
  if documents
124
124
  @documents = documents[:inputs].map do |document|
125
- document.merge!(file: GroupDocs::Storage::File.new(document))
125
+ document.merge!(:file => GroupDocs::Storage::File.new(document))
126
126
  Document.new(document)
127
127
  end
128
128
  end
@@ -152,7 +152,7 @@ module GroupDocs
152
152
  # @return [Array<Symbol>]
153
153
  #
154
154
  def actions
155
- @actions.split(', ').map { |action| variable_to_accessor(action) } if @actions
155
+ @actions.split(', ').map { |action| action.underscore.to_sym } if @actions
156
156
  end
157
157
 
158
158
  #
@@ -172,14 +172,14 @@ module GroupDocs
172
172
 
173
173
  self.status = json[:job_status]
174
174
  documents = {
175
- inputs: [],
176
- outputs: [],
175
+ :inputs => [],
176
+ :outputs => [],
177
177
  }
178
178
 
179
179
  # add input documents
180
180
  if json[:inputs]
181
181
  json[:inputs].each do |document|
182
- document.merge!(file: GroupDocs::Storage::File.new(document))
182
+ document.merge!(:file => GroupDocs::Storage::File.new(document))
183
183
  documents[:inputs] << Document.new(document)
184
184
  end
185
185
  end
@@ -187,7 +187,7 @@ module GroupDocs
187
187
  # add output documents
188
188
  if json[:outputs]
189
189
  json[:outputs].each do |document|
190
- document.merge!(file: GroupDocs::Storage::File.new(document))
190
+ document.merge!(:file => GroupDocs::Storage::File.new(document))
191
191
  documents[:outputs] << Document.new(document)
192
192
  end
193
193
  end
@@ -276,7 +276,7 @@ module GroupDocs
276
276
  # @return [Integer] Document ID
277
277
  #
278
278
  def add_url!(url, options = {}, access = {})
279
- options.merge!(absolute_url: url)
279
+ options.merge!(:absolute_url => url)
280
280
 
281
281
  api = Api::Request.new do |request|
282
282
  request[:access] = access
@@ -238,7 +238,7 @@ module GroupDocs
238
238
  end.execute!
239
239
 
240
240
  json[:collectors].map do |collector|
241
- collector.merge!(questionnaire: self)
241
+ collector.merge!(:questionnaire => self)
242
242
  Collector.new(collector)
243
243
  end
244
244
  end
@@ -301,7 +301,7 @@ module GroupDocs
301
301
  request[:method] = :GET
302
302
  request[:path] = "/merge/{{client_id}}/questionnaires/#{guid}/fields"
303
303
  end
304
- api.add_params(include_geometry: true)
304
+ api.add_params(:include_geometry => true)
305
305
  json = api.execute!
306
306
 
307
307
  json[:fields].map do |field|
@@ -20,7 +20,7 @@ module GroupDocs
20
20
  end.execute!
21
21
 
22
22
  collector = json[:collector]
23
- collector.merge!(questionnaire: Questionnaire.new(id: collector[:questionnaire_id]))
23
+ collector.merge!(:questionnaire => Questionnaire.new(:id => collector[:questionnaire_id]))
24
24
 
25
25
  new(collector)
26
26
  end
@@ -255,7 +255,7 @@ module GroupDocs
255
255
  api.add_params(options)
256
256
  json = api.execute!
257
257
 
258
- Job.new(id: json[:job_id])
258
+ Job.new(:id => json[:job_id])
259
259
  end
260
260
 
261
261
  end # Questionnaire::Collector
@@ -174,7 +174,7 @@ module GroupDocs
174
174
  api.add_params(options)
175
175
  json = api.execute!
176
176
 
177
- Job.new(id: json[:job_id])
177
+ Job.new(:id => json[:job_id])
178
178
  end
179
179
 
180
180
  end # Questionnaire::Execution
@@ -60,7 +60,7 @@ module GroupDocs
60
60
  #
61
61
  def type=(type)
62
62
  if type.is_a?(Symbol)
63
- type = accessor_to_variable(type).to_s.delete(?@)
63
+ type = type.to_s.camelize
64
64
  TYPES.include?(type) or raise ArgumentError, "Unknown type: #{type.inspect}"
65
65
  end
66
66
 
@@ -73,7 +73,7 @@ module GroupDocs
73
73
  # @return [Symbol]
74
74
  #
75
75
  def type
76
- variable_to_accessor(@type)
76
+ @type.underscore.to_sym
77
77
  end
78
78
 
79
79
  end # Questionnaire::Question