This class represents a radio button found in a Form. To activate the RadioButton in the Form, set the checked method to true.
# File lib/mechanize/form/radio_button.rb, line 8 def initialize node, form @checked = !!node['checked'] @form = form super(node) end
# File lib/mechanize/form/radio_button.rb, line 35 def [](key) @node[key] end
# File lib/mechanize/form/radio_button.rb, line 14 def check uncheck_peers @checked = true end
# File lib/mechanize/form/radio_button.rb, line 23 def click checked ? uncheck : check end
# File lib/mechanize/form/radio_button.rb, line 27 def label (id = self['id']) && @form.page.labels_hash[id] || nil end
# File lib/mechanize/form/radio_button.rb, line 31 def text label.text rescue nil end
# File lib/mechanize/form/radio_button.rb, line 19 def uncheck @checked = false end