Class: ActsAsDashboard::Widget
- Inherits:
-
Object
- Object
- ActsAsDashboard::Widget
- Defined in:
- lib/acts_as_dashboard/widget.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#update_interval ⇒ Object
Returns the value of attribute update_interval.
Instance Method Summary collapse
- #attributes ⇒ Object
- #data(&block) ⇒ Object
-
#initialize(options = {}) ⇒ Widget
constructor
A new instance of Widget.
Constructor Details
#initialize(options = {}) ⇒ Widget
Returns a new instance of Widget.
9 10 11 12 13 14 15 |
# File 'lib/acts_as_dashboard/widget.rb', line 9 def initialize( = {}) self.type = [:type] if [:type] self.name = [:name] if [:name] self.title = [:title] if [:title] self.block = [:block] if [:block] self.update_interval = [:update_interval] if [:update_interval] end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
6 7 8 |
# File 'lib/acts_as_dashboard/widget.rb', line 6 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/acts_as_dashboard/widget.rb', line 4 def name @name end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/acts_as_dashboard/widget.rb', line 5 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/acts_as_dashboard/widget.rb', line 3 def type @type end |
#update_interval ⇒ Object
Returns the value of attribute update_interval.
7 8 9 |
# File 'lib/acts_as_dashboard/widget.rb', line 7 def update_interval @update_interval end |
Instance Method Details
#attributes ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/acts_as_dashboard/widget.rb', line 46 def attributes { :type => @type, :name => @name, :title => @title, :update_interval => @update_interval, } end |
#data(&block) ⇒ Object
37 38 39 |
# File 'lib/acts_as_dashboard/widget.rb', line 37 def data(&block) self.block = block end |