module Scrivito # @api public # The +WidgetCollection+ represents all {Scrivito::BasicWidget Widgets} referenced by an # {Scrivito::BasicObj Obj} or its subwidgets. class WidgetCollection def initialize(obj) @obj = obj end # @api public # Access a {Scrivito::BasicWidget Widget} by its +id+ # @param [String] widget_id the id of the widget # @return [Scrivito::BasicWidget, nil] the Widget with the given +widget_id+ or nil def [](widget_id) obj.widget_from_pool(widget_id) end private attr_reader :obj end end