lib/widget.rb in scrivito_sdk-0.18.1 vs lib/widget.rb in scrivito_sdk-0.30.0.rc1
- old
+ new
@@ -1,3 +1,21 @@
-# Empty implementation for Widget.
-# Only unsed in case the app does not define Widget itself.
-::Widget = Class.new(::Scrivito::BasicWidget)
+#
+# The class +Widget+ should be overridden by the application (see example).
+# The SDK provides methods for +Widget+ through it's abstract base class, {Scrivito::BasicWidget}.
+# The SDK provides this empty implementation for +Widget+ which will only be used in case the app
+# does not define the class +Widget+ itself.
+#
+# @api public
+#
+# @example
+# # in app/models/widget.rb
+# class Widget < Scrivito::BasicWidget
+# # Put custom extensions that apply to all +Widget+s here...
+# end
+#
+# # in app/models/text_widget.rb
+# class TextWidget < ::Widget
+# # Put custom extensions that only apply to +TextWidget+s here...
+# end
+#
+class Widget < Scrivito::BasicWidget
+end