Sha256: c61ff84822abffff9182fc3d251ea36f3a13130d0f6d03e6a0967e81f30382a8
Contents?: true
Size: 605 Bytes
Versions: 21
Compression:
Stored size: 605 Bytes
Contents
class Class # Converts a class name to a suitable method name # # My::ClassName.method_name => "my__class_name" # def method_name # inspired by facet/string/underscore name.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').gsub('::','__').downcase end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCClass < Test::Unit::TestCase def test_method_name assert_equal( Test::Unit::TestCase.method_name, 'test__unit__test_case' ) end end =end
Version data entries
21 entries across 21 versions & 1 rubygems