method

underscore

Importance_0
RSpec latest stable (1.3.1) - 0 notes - Class: Spec::Example::ExampleMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (1.1.12) is shown here.

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.