lib/watir-webdriver/elements/checkbox.rb in watir-webdriver-0.6.1 vs lib/watir-webdriver/elements/checkbox.rb in watir-webdriver-0.6.2
- old
+ new
@@ -2,20 +2,21 @@
module Watir
class CheckBox < Input
#
- # Set this checkbox to the given value
+ # Sets checkbox to the given value.
#
- # Example:
- #
+ # @example
# checkbox.set? #=> false
# checkbox.set
# checkbox.set? #=> true
# checkbox.set(false)
# checkbox.set? #=> false
#
+ # @param [Boolean] bool
+ #
def set(bool = true)
assert_exists
assert_enabled
@@ -25,28 +26,29 @@
@element.click if bool
end
end
#
- # returns true if the element is checked
+ # Returns true if the element is checked
# @return [Boolean]
#
def set?
assert_exists
@element.selected?
end
#
- # Unset this checkbox.
+ # Unsets checkbox.
#
# Same as +set(false)+
#
def clear
set false
end
+
end # CheckBox
module Container
def checkbox(*args)
CheckBox.new(self, extract_selector(args).merge(:tag_name => "input", :type => "checkbox"))
@@ -60,6 +62,6 @@
class CheckBoxCollection < InputCollection
def element_class
CheckBox
end
end # CheckBoxCollection
-end
+end # Watir