Class: SelectOptionTag
- Inherits:
-
REXML::Element
- Object
- REXML::Element
- SelectOptionTag
- Defined in:
- lib/ribit/xhtmltag.rb
Constant Summary collapse
- TAG_NAME =
'option'- VALUE =
'value'- SELECTED =
'selected'
Instance Method Summary collapse
-
#initialize(value, text = nil) ⇒ SelectOptionTag
constructor
A new instance of SelectOptionTag.
- #set_selected ⇒ Object
Constructor Details
#initialize(value, text = nil) ⇒ SelectOptionTag
101 102 103 104 105 106 107 |
# File 'lib/ribit/xhtmltag.rb', line 101 def initialize( value, text=nil ) super( TAG_NAME ) attributes[VALUE] = value text = value unless text != nil self.text = text end |
Instance Method Details
#set_selected ⇒ Object
110 111 112 |
# File 'lib/ribit/xhtmltag.rb', line 110 def set_selected attributes[SELECTED] = 'selected' end |