Class: VR::Col::ComboCol
- Inherits:
-
Object
- Object
- VR::Col::ComboCol
- Defined in:
- lib/treeview/columns/ComboCol.rb
Overview
can’t subclass String tried twice!!!
Instance Attribute Summary collapse
-
#selected ⇒ Object
Returns the value of attribute selected.
-
#selections ⇒ Object
Returns the value of attribute selections.
Instance Method Summary collapse
-
#initialize(current_selection, *selections) ⇒ ComboCol
constructor
This defines a combobox for a row in VR::ListView or VR::TreeView.
- #valid?(str) ⇒ Boolean
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
#selected ⇒ Object
Returns the value of attribute selected.
23 24 25 |
# File 'lib/treeview/columns/ComboCol.rb', line 23 def selected @selected end |
#selections ⇒ Object
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
37 38 39 |
# File 'lib/treeview/columns/ComboCol.rb', line 37 def valid?(str) @selections.include?(str) end |