lib/scrivito/basic_widget.rb in scrivito_sdk-1.2.0.rc1 vs lib/scrivito/basic_widget.rb in scrivito_sdk-1.2.0.rc2
- old
+ new
@@ -188,10 +188,11 @@
# {Scrivito::BasicObj Obj}, since initially the copy is not stored in such a field.
#
# @example Duplicate the first widget contained in the +my_widget+ field.
# obj.update(my_widgets: obj.my_widgets.push(obj.my_widgets.first.copy))
#
+ # @return [Scrivito::BasicWidget] a copy of this widget
def copy
attributes = {}
attribute_definitions.each do |attribute_definition|
attribute_name = attribute_definition.name
attribute_value = read_attribute(attribute_name)
@@ -317,21 +318,25 @@
end
end
# Returns the entity ({Scrivito::BasicObj} or {Scrivito::BasicWidget}) that references this widget.
# @api public
+ #
+ # @return [Scrivito::AttributeContent] the entity that references this widget.
def container
@container || container_and_attribute_name.first
end
# Returns the name of the +widgetlist+ attribute that references this widget.
+ # @return [String] the name of the attribute that references this widget.
# @api public
def container_attribute_name
@container_attribute_name || container_and_attribute_name.second
end
# Returns the name of the 'widgetlist' field that references this widget.
# @api public
+ # @return [String] the name of the attribute that references this widget.
# @deprecated
def container_field_name
Scrivito::Deprecation.warn('Scrivito::BasicWidget#container_field_name is deprecated'\
' and will be removed in a future version.'\
' Please use Scrivito::BasicWidget#container_attribute_name instead.')