Class: Watir::Util
- Inherits:
-
Object
- Object
- Watir::Util
- Defined in:
- lib/watir-classic/util.rb
Class Method Summary collapse
Class Method Details
.demodulize(str) ⇒ Object
7 8 9 |
# File 'lib/watir-classic/util.rb', line 7 def demodulize(str) str.gsub(/^.*::/, '') end |
.singularize(str) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/watir-classic/util.rb', line 21 def singularize(str) case str.downcase when "checkboxes" str.chop.chop when "bodies" str.chop.chop.chop + "y" else str.chop end end |
.underscore(str) ⇒ Object
13 14 15 |
# File 'lib/watir-classic/util.rb', line 13 def underscore(str) str.gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') end |