Module: Watir
- Defined in:
- lib/watir-formhandler/radio.rb,
lib/watir-formhandler/watir.rb,
lib/watir-formhandler/select.rb,
lib/watir-formhandler/element.rb,
lib/watir-formhandler/check_box.rb,
lib/watir-formhandler/container.rb,
lib/watir-formhandler/text_area.rb,
lib/watir-formhandler/file_field.rb,
lib/watir-formhandler/text_field.rb,
lib/watir-formhandler/option_group.rb
Defined Under Namespace
Modules: Container Classes: CheckBox, Element, FileField, HTMLElement, OptionGroup, Radio, Select, TextArea, TextField
Class Method Summary collapse
-
.extend_tag_to_class(tag, tag_class) ⇒ Hash
As the tag_to_class hash is frozen once Watir is done loading its base classes, it cannot be extended with custom classes.
Class Method Details
.extend_tag_to_class(tag, tag_class) ⇒ Hash
As the tag_to_class hash is frozen once Watir is done loading its base classes, it cannot be extended with custom classes. Therefore, extend_tag_to_class unfreezes it, by replacing it with a duplicate and freezing it again after the addition.
9 10 11 12 |
# File 'lib/watir-formhandler/watir.rb', line 9 def self.extend_tag_to_class(tag, tag_class) @tag_to_class = @tag_to_class.dup.merge(tag => tag_class) @tag_to_class.freeze end |