Method: Scrivito::WidgetCollection#each

Defined in:
app/cms/scrivito/widget_collection.rb

#each {|Scrivito::BasicWidget| ... } ⇒ Object

Enables you to iterate the Widgets of an Obj. Includes the Enumerable mixin and thereby provides methods like map or select.

Examples:

Array of all widget ids

obj.widgets.map { |widget| widget.id }

Yields:



29
30
31
# File 'app/cms/scrivito/widget_collection.rb', line 29

def each(&block)
  obj.contained_widgets.each(&block)
end