Sha256: 651348bbb45ba9694520fd23435510abb4541caca929adc9c07fd7af20660854

Contents?: true

Size: 772 Bytes

Versions: 10

Compression:

Stored size: 772 Bytes

Contents

# encoding: utf-8
module Watir
  class Radio < Input

    #
    # Selects this radio button.
    #

    def set
      assert_exists
      assert_enabled

      @element.click unless set?
    end

    #
    # Is this radio set?
    #
    # @return [Boolean]
    #

    def set?
      assert_exists
      @element.selected?
    end

  end # Radio

  module Container
    def radio(*args)
      Radio.new(self, extract_selector(args).merge(:tag_name => "input", :type => "radio"))
    end

    def radios(*args)
      RadioCollection.new(self, extract_selector(args).merge(:tag_name => "input", :type => "radio" ))
    end
  end # Container

  class RadioCollection < InputCollection
    private

    def element_class
      Radio
    end
  end # RadioCollection
end # Watir

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
watir-webdriver-0.6.11 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.10 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.9 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.8 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.7 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.6 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.5 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.4 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.3 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.6.2 lib/watir-webdriver/elements/radio.rb