Class: ActsAsDashboard::ShortMessagesWidget

Inherits:
Widget
  • Object
show all
Defined in:
lib/acts_as_dashboard/short_messages_widget.rb

Constant Summary collapse

@@default_max_data_items =
5

Instance Attribute Summary collapse

Attributes inherited from Widget

#block, #name, #title, #type, #update_interval

Instance Method Summary collapse

Methods inherited from Widget

#data

Constructor Details

#initialize(options = {}) ⇒ ShortMessagesWidget

Returns a new instance of ShortMessagesWidget.



7
8
9
10
11
12
13
14
# File 'lib/acts_as_dashboard/short_messages_widget.rb', line 7

def initialize(options = {})
  options.delete :type

  self.type           = :short_messages
  self.max_data_items = options[:max_data_items] || @@default_max_data_items

  super
end

Instance Attribute Details

#max_data_itemsObject

Returns the value of attribute max_data_items.



5
6
7
# File 'lib/acts_as_dashboard/short_messages_widget.rb', line 5

def max_data_items
  @max_data_items
end

Instance Method Details

#attributesObject



21
22
23
# File 'lib/acts_as_dashboard/short_messages_widget.rb', line 21

def attributes
  super.merge(:max_data_items => @max_data_items)
end