Class: Watir::RadioCheckCommon
- Inherits:
-
InputElement
- Object
- Element
- InputElement
- Watir::RadioCheckCommon
- Defined in:
- lib/watir/input_elements.rb,
lib/watir/camel_case.rb
Overview
This class contains common methods to both radio buttons and check boxes. Normally a user would not need to create this object as it is returned by the Watir::Container#checkbox or by Watir::Container#radio methods – most of the methods available to this element are inherited from the Element class
Constant Summary
Constants inherited from Element
Instance Attribute Summary
Attributes inherited from Element
Attributes included from Container
#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed
Instance Method Summary collapse
- #getState ⇒ Object
-
#initialize(container, how, what, value = nil) ⇒ RadioCheckCommon
constructor
A new instance of RadioCheckCommon.
- #inspect ⇒ Object
- #isSet? ⇒ Object
-
#locate ⇒ Object
:nodoc:.
-
#set? ⇒ Boolean
(also: #checked?)
This method determines if a radio button or check box is set.
Methods inherited from Element
#<=>, #activeObjectHighLightColor, #after_text, #assert_enabled, #assert_exists, #attribute_value, #before_text, #click, #click!, #document, #enabled?, #exists?, #fire_event, #flash, #focus, #method_missing, #ole_object, #ole_object=, #parent, #text, #to_s, #type_keys, #typingspeed, #visible?
Methods included from Container
#area, #areas, #button, #buttons, #cell, #cells, #checkbox, #checkboxes, #dds, #divs, #dls, #dts, #element, #element_by_css, #elements, #ems, #file_field, #file_fields, #form, #forms, #frame, #frames, #hidden, #hiddens, #image, #images, #labels, #link, #links, #lis, #locate_all_elements, #locate_input_element, #locate_tagged_element, #log, #map, #maps, #modal_dialog, #popup, #pres, #ps, #radio, #radios, #row, #rows, #select_list, #select_lists, #set_container, #show_all_objects, #spans, #strongs, #table, #tables, #text_field, #text_fields, #wait
Constructor Details
#initialize(container, how, what, value = nil) ⇒ RadioCheckCommon
Returns a new instance of RadioCheckCommon.
532 533 534 535 |
# File 'lib/watir/input_elements.rb', line 532 def initialize(container, how, what, value=nil) super container, how, what @value = value end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Watir::Element
Instance Method Details
#getState ⇒ Object
50 |
# File 'lib/watir/camel_case.rb', line 50 alias getState set? |
#inspect ⇒ Object
537 538 539 |
# File 'lib/watir/input_elements.rb', line 537 def inspect '#<%s:0x%x located=%s how=%s what=%s value=%s>' % [self.class, hash*2, !!ole_object, @how.inspect, @what.inspect, @value.inspect] end |
#isSet? ⇒ Object
51 |
# File 'lib/watir/camel_case.rb', line 51 alias isSet? set? |
#locate ⇒ Object
:nodoc:
529 530 531 |
# File 'lib/watir/input_elements.rb', line 529 def locate #:nodoc: @o = @container.locate_input_element(@how, @what, self.class::INPUT_TYPES, @value, self.class) end |
#set? ⇒ Boolean Also known as: checked?
This method determines if a radio button or check box is set. Returns true if set/checked; false if not set/checked. Raises UnknownObjectException if its unable to locate an object.
544 545 546 547 |
# File 'lib/watir/input_elements.rb', line 544 def set? assert_exists return @o.checked end |