lib/groupdocs/document/field.rb in groupdocs-1.1.0 vs lib/groupdocs/document/field.rb in groupdocs-1.2.0
- old
+ new
@@ -5,23 +5,25 @@
attr_accessor :page
# @attr [String] name
attr_accessor :name
# @attr [String] type
attr_accessor :type
- # @attr [GroupDocs::Document::Rectangle] rectangle
- attr_accessor :rectangle
+ # @attr [GroupDocs::Document::Rectangle] rect
+ attr_accessor :rect
#
# Coverts passed hash to GroupDocs::Document::Rectangle object.
- #
# @param [Hash] options
- # @return [GroupDocs::Document::Rectangle]
#
- def rectangle=(options)
- @rectangle = GroupDocs::Document::Rectangle.new(options)
+ def rect=(rectangle)
+ if rectangle.is_a?(Hash)
+ rectangle = GroupDocs::Document::Rectangle.new(rectangle)
+ end
+
+ @rect = rectangle
end
- # Compatibility with response JSON
- alias_method :rect=, :rectangle=
+ # Human-readable accessors
+ alias_accessor :rectangle, :rect
end # Document::Field
end # GroupDocs