Class: Watir::Radio

Inherits:
Object
  • Object
show all
Defined in:
lib/watir-formhandler/radio.rb

Overview

Extends the Watir::Radio class to add #set and #field_value methods.

Instance Method Summary collapse

Instance Method Details

#field_valueBoolean

Returns whether this CheckBox is set or not.

Returns:

  • (Boolean)

    is checked?



16
17
18
# File 'lib/watir-formhandler/radio.rb', line 16

def field_value
  checked?
end

#set(value) ⇒ Object

Clicks this Radio unless #checked? returns the same value as the given one.

Parameters:

  • value (Boolean)

    to be set.

Returns:

  • nil



9
10
11
# File 'lib/watir-formhandler/radio.rb', line 9

def set(value)
  click unless checked? || !value
end