Class: FireWatir::CheckboxGroups
- Defined in:
- lib/watirloo/extension/firewatir_ducktape.rb
Instance Method Summary collapse
-
#[](n) ⇒ Object
allows access to a specific item in the collection.
-
#initialize(container) ⇒ CheckboxGroups
constructor
def element_class; CheckboxGroup; end.
- #length ⇒ Object
-
#locate_elements ⇒ Object
return array of unique names for checkboxes in container.
Constructor Details
#initialize(container) ⇒ CheckboxGroups
def element_class; CheckboxGroup; end
119 120 121 122 123 124 125 126 127 |
# File 'lib/watirloo/extension/firewatir_ducktape.rb', line 119 def initialize(container) @container = container elements = locate_elements @element_objects = [] # for each unique name create a checkbox_group elements.each do |name| @element_objects << CheckboxGroup.new(container, name) end end |
Instance Method Details
#[](n) ⇒ Object
allows access to a specific item in the collection. 1-based index
144 145 146 |
# File 'lib/watirloo/extension/firewatir_ducktape.rb', line 144 def [](n) @element_objects[n-1] end |
#length ⇒ Object
129 130 131 |
# File 'lib/watirloo/extension/firewatir_ducktape.rb', line 129 def length @element_objects.size end |
#locate_elements ⇒ Object
return array of unique names for checkboxes in container
134 135 136 137 138 139 140 |
# File 'lib/watirloo/extension/firewatir_ducktape.rb', line 134 def locate_elements names = [] @container.checkboxes.each do |cb| names << cb.name end names.uniq #non repeating names end |