Sha256: 1fc643199731110d6db64dafc2d99c649cf1898a1a4308fb26324ff2aa14ca23

Contents?: true

Size: 708 Bytes

Versions: 11

Compression:

Stored size: 708 Bytes

Contents

module Watir
  class Radio < Input

    #
    # Selects this radio button.
    #

    def set
      click unless set?
    end

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

    def set?
      assert_exists
      element_call { @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

11 entries across 11 versions & 2 rubygems

Version Path
watir-webdriver-0.9.9 lib/watir-webdriver/elements/radio.rb
watir-6.0.0.beta5 lib/watir/elements/radio.rb
watir-6.0.0.beta4 lib/watir/elements/radio.rb
watir-6.0.0.beta3 lib/watir/elements/radio.rb
watir-6.0.0.beta2 lib/watir/elements/radio.rb
watir-6.0.0.beta1 lib/watir/elements/radio.rb
watir-webdriver-0.9.3 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.9.2 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.9.1 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.9.0 lib/watir-webdriver/elements/radio.rb
watir-webdriver-0.8.0 lib/watir-webdriver/elements/radio.rb