Class: SelectOptionTag

Inherits:
REXML::Element
  • Object
show all
Defined in:
lib/ribit/xhtmltag.rb

Constant Summary collapse

TAG_NAME =
'option'
VALUE =
'value'
SELECTED =
'selected'

Instance Method Summary collapse

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_selectedObject



110
111
112
# File 'lib/ribit/xhtmltag.rb', line 110

def set_selected
  attributes[SELECTED] = 'selected'
end