lib/groupdocs/document/annotation.rb in groupdocs-1.2.11 vs lib/groupdocs/document/annotation.rb in groupdocs-1.3.0
- old
+ new
@@ -64,11 +64,11 @@
# @param [Symbol] type
# @raise [ArgumentError] if type is unknown
#
def type=(type)
if type.is_a?(Symbol)
- type = accessor_to_variable(type).to_s.delete(?@)
+ type = type.to_s.camelize
TYPES.include?(type) or raise ArgumentError, "Unknown type: #{type.inspect}"
end
@type = type
end
@@ -77,11 +77,11 @@
# Returns type in human-readable format.
#
# @return [Symbol]
#
def type
- variable_to_accessor(@type)
+ @type.underscore.to_sym
end
#
# Converts access mode to machine-readable format.
#
@@ -128,11 +128,11 @@
if replies
@replies = replies.map do |reply|
if reply.is_a?(GroupDocs::Document::Annotation::Reply)
reply
else
- reply.merge!(annotation: self)
+ reply.merge!(:annotation => self)
Document::Annotation::Reply.new(reply)
end
end
end
end
@@ -219,14 +219,14 @@
def move!(x, y, access = {})
Api::Request.new do |request|
request[:access] = access
request[:method] = :PUT
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/position"
- request[:request_body] = { x: x, y: y }
+ request[:request_body] = { :x => x, :y => y }
end.execute!
- self.annotation_position = { x: x, y: y }
+ self.annotation_position = { :x => x, :y => y }
end
#
# Moves annotation marker to given coordinates.
#
@@ -239,17 +239,17 @@
def move_marker!(x, y, access = {})
Api::Request.new do |request|
request[:access] = access
request[:method] = :PUT
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/markerPosition"
- request[:request_body] = { x: x, y: y }
+ request[:request_body] = { :x => x, :y => y }
end.execute!
if box
box.x = x
box.y = y
else
- self.box = { x: x, y: y }
+ self.box = { :x => x, :y => y }
end
end
#
# Sets access mode.