Class: VR::Col::ComboCol

Inherits:
Object
  • Object
show all
Defined in:
lib/treeview/columns/ComboCol.rb

Overview

can’t subclass String tried twice!!!

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_selection, *selections) ⇒ ComboCol

This defines a combobox for a row in VR::ListView or VR::TreeView. You pass three or more strings

to the constructor, and the first string is the selected value that appears in the row in the 
view.

- current_selection (type String)
- selections (comma separated list of Strings)


32
33
34
35
# File 'lib/treeview/columns/ComboCol.rb', line 32

def initialize(current_selection, *selections)
  @selected = current_selection
  @selections = selections
end

Instance Attribute Details

#selectedObject

Returns the value of attribute selected.



23
24
25
# File 'lib/treeview/columns/ComboCol.rb', line 23

def selected
  @selected
end

#selectionsObject

Returns the value of attribute selections.



23
24
25
# File 'lib/treeview/columns/ComboCol.rb', line 23

def selections
  @selections
end

Instance Method Details

#valid?(str) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/treeview/columns/ComboCol.rb', line 37

def valid?(str)
  @selections.include?(str)
end