Method: Scrivito::BasicWidget#copy
- Defined in:
- lib/scrivito/basic_widget.rb
#copy ⇒ Object
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/scrivito/basic_widget.rb', line 127 def copy attributes = {} attribute_definitions.each do |attribute_definition| attribute_name = attribute_definition.name attribute_value = read_attribute(attribute_name) attribute_value = attribute_value.map(&:copy) if attribute_definition. attributes[attribute_name] = attribute_value end self.class.new(attributes) end |