Class: Appboard::WidgetPusher::Widget
- Inherits:
-
Object
- Object
- Appboard::WidgetPusher::Widget
- Defined in:
- lib/appboard/widgetpusher.rb
Overview
Defines widget
Instance Method Summary collapse
- #data(&block) ⇒ Object
- #get_data ⇒ Object
-
#initialize(name, &block) ⇒ Widget
constructor
A new instance of Widget.
- #name ⇒ Object
- #uid(value = nil) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Widget
Returns a new instance of Widget.
6 7 8 9 |
# File 'lib/appboard/widgetpusher.rb', line 6 def initialize(name, &block) @name = name instance_eval(&block) end |
Instance Method Details
#data(&block) ⇒ Object
20 21 22 23 |
# File 'lib/appboard/widgetpusher.rb', line 20 def data(&block) @data = block if block_given? @data end |
#get_data ⇒ Object
25 26 27 |
# File 'lib/appboard/widgetpusher.rb', line 25 def get_data @data.call() end |
#name ⇒ Object
11 12 13 |
# File 'lib/appboard/widgetpusher.rb', line 11 def name @name end |
#uid(value = nil) ⇒ Object
15 16 17 18 |
# File 'lib/appboard/widgetpusher.rb', line 15 def uid(value = nil) @uid = value unless value.nil? @uid end |