Method: Appboard::DashboardSetup::Dashboard#widget
- Defined in:
- lib/appboard/dashboardsetup.rb
#widget(widget_name) ⇒ Object
Define a widget. May be called inside push loop or separately
widget(‘name’)
type "..."
size "..."
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/appboard/dashboardsetup.rb', line 39 def () if block_given? block = Proc.new = Widget.new(, &block) raise ArgumentError, "Widget with name '#{widget_name.to_s}' is already defined" if [.to_s] [.to_s] = else = [.to_s] raise ArgumentError, "Widget is not defined, to define new widget you must supply a block as the last argument" if .nil? end end |