lib/groupdocs/document/annotation.rb in groupdocs-0.3.8 vs lib/groupdocs/document/annotation.rb in groupdocs-0.3.9
- old
+ new
@@ -3,11 +3,11 @@
require 'groupdocs/document/annotation/reply'
include Api::Helpers::AccessMode
- TYPES = %w(Text Area Point)
+ TYPES = %w(Text Area Point TextStrikeout Polyline)
# @attr [GroupDocs::Document] document
attr_accessor :document
# @attr [Integer] id
attr_accessor :id
@@ -65,11 +65,11 @@
# @param [Symbol] type
# @raise [ArgumentError] if type is unknown
#
def type=(type)
if type.is_a?(Symbol)
- type = type.to_s.capitalize
+ type = accessor_to_variable(type).to_s.delete(?@)
TYPES.include?(type) or raise ArgumentError, "Unknown type: #{type.inspect}"
end
@type = type
end
@@ -78,10 +78,10 @@
# Returns type in human-readable format.
#
# @return [Symbol]
#
def type
- @type.downcase.to_sym
+ variable_to_accessor(@type)
end
#
# Converts access mode to machine-readable format.
#