Class: LCDProc::MenuItems::Numeric
- Inherits:
-
Object
- Object
- LCDProc::MenuItems::Numeric
- Includes:
- LCDProc::MenuItem
- Defined in:
- lib/lcdproc/menu_items/numeric.rb
Constant Summary collapse
- @@numeric_item_count =
0
Instance Attribute Summary
Attributes included from LCDProc::MenuItem
#id, #is_hidden, #lcdproc_event_type, #lcdproc_options, #lcdproc_type, #next, #parent_menu, #previous, #text
Instance Method Summary collapse
-
#initialize(user_options = {}, lcdproc_options = {}) ⇒ Numeric
constructor
-
:maxvalue
- The maximum value that the numeric should allow.
-
Methods included from LCDProc::MenuItem
add_support, #lcdproc_options_as_string, new, supported_types
Constructor Details
#initialize(user_options = {}, lcdproc_options = {}) ⇒ Numeric
-
:maxvalue
- The maximum value that the numeric should allow. Defaults to 100.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/lcdproc/menu_items/numeric.rb', line 48 def initialize( = {}, = {} ) @lcdproc_options = {} if [:id].nil? @id = "NumericMenuItem_#{@@numeric_item_count}" else @id = [:id] end @lcdproc_type = "numeric" @lcdproc_event_type = "update" @lcdproc_options[:text] = @id @lcdproc_options[:minvalue] = 0 @lcdproc_options[:maxvalue] = 100 @lcdproc_options.update( ) @lcdproc_options[:text] = "\"#{@lcdproc_options[:text]}\"" @@numeric_item_count += 1 end |