lib/groupdocs/document/annotation.rb in groupdocs-1.5.5 vs lib/groupdocs/document/annotation.rb in groupdocs-1.5.6
- old
+ new
@@ -164,23 +164,26 @@
#
# Creates new annotation.
#
# @example
# document = GroupDocs::Storage::Folder.list!.first.to_document
- # annotation = GroupDocs::Document::Annotation.new(document: document)
+ # annotation = GroupDocs::Document::Annotation.new(document: document) #
# annotation.create!
#
+ # @param [Hash] info Annotation info
+ # @option info [Array] :box
+ # @option info [Array] :annotationPosition
# @param [Hash] access Access credentials
# @option access [String] :client_id
# @option access [String] :private_key
#
- def create!(access = {})
+ def create!(info, access = {})
json = Api::Request.new do |request|
request[:access] = access
request[:method] = :POST
request[:path] = "/ant/{{client_id}}/files/#{document.file.guid}/annotations"
- request[:request_body] = to_hash
+ request[:request_body] = info
end.execute!
json.each do |field, value|
send(:"#{field}=", value) if respond_to?(:"#{field}=")
end
@@ -191,11 +194,11 @@
#
# @param [Hash] access Access credentials
# @option access [String] :client_id
# @option access [String] :private_key
#
- def remove!(access = {})
+ def self.remove!(guid, access = {})
Api::Request.new do |request|
request[:access] = access
request[:method] = :DELETE
request[:path] = "/ant/{{client_id}}/annotations/#{guid}"
end.execute!
@@ -293,10 +296,10 @@
def resize!(x, y, access = {})
Api::Request.new do |request|
request[:access] = access
request[:method] = :PUT
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/size"
- request[:request_body] = { :x => x, :y => y }
+ request[:request_body] = { :width => x, :height => y }
end.execute!
self.width = x
self.height = y
end