Class: Appboard::WidgetPusher::Widget

Inherits:
Object
  • Object
show all
Defined in:
lib/appboard/widgetpusher.rb

Overview

Defines widget

Instance Method Summary collapse

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_dataObject



25
26
27
# File 'lib/appboard/widgetpusher.rb', line 25

def get_data
  @data.call()
end

#nameObject



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