Class: Appboard::WidgetPusher
- Inherits:
-
Object
- Object
- Appboard::WidgetPusher
- Defined in:
- lib/appboard/widgetpusher.rb
Overview
Widget pusher
Defined Under Namespace
Classes: Widget
Instance Method Summary collapse
-
#apiKey(value = nil) ⇒ Object
Define API key.
- #get_widgets ⇒ Object
-
#widget(widget_name = nil) ⇒ Object
Define a widget.
Instance Method Details
#apiKey(value = nil) ⇒ Object
Define API key
31 32 33 34 |
# File 'lib/appboard/widgetpusher.rb', line 31 def apiKey(value = nil) @apiKey = value unless value.nil? @apiKey end |
#get_widgets ⇒ Object
58 59 60 |
# File 'lib/appboard/widgetpusher.rb', line 58 def end |
#widget(widget_name = nil) ⇒ Object
Define a widget. May be called inside push loop or separately
widget(‘name’)
uid "..."
data do
# Data is here
end
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/appboard/widgetpusher.rb', line 46 def ( = nil) if block_given? block = Proc.new = Widget.new(, &block) ( ||= []) << self else raise ArgumentError, "Widget is not defined, to define new widget you must supply a block as the last argument" if .nil? end end |