method

underscore

Importance_0
1.1.12 - Show latest stable - 0 notes - Class: Spec::Example::ExampleMethods
underscore(camel_cased_word) private

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/example/example_methods.rb, line 160
      def underscore(camel_cased_word)
        camel_cased_word.to_s.gsub(/::/, '_').
          gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
          gsub(/([a-z\d])([A-Z])/,'\1_\2').
          tr("-", "_").
          downcase
      end
Register or log in to add new notes.