Sha256: 3cba3cfd186ce80e3aa8b33608f288c37ed29fc3a1c6833cfebfa70387462608
Contents?: true
Size: 930 Bytes
Versions: 22
Compression:
Stored size: 930 Bytes
Contents
require 'facet/string/camelcase' class Symbol # Converts a symbol to camelcase. By default capitalization # occurs on whitespace and underscores. By setting the first # parameter to <tt>true</tt> the first character can also be # captizlized. The second parameter can be assigned a valid # Regualr Expression characeter set to determine which # characters to match for capitalizing subsequent parts of # the symbol. # # :this_is_a_test.camelcase #=> :ThisIsATest # :this_is_a_test.camelcase(false) #=> :thisIsATest # def camelcase( *args ) self.to_s.camelcase( *args ).to_sym end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCSymbol < Test::Unit::TestCase def test_camelcase assert_equal( :thisIsTest, :this_is_test.camelcase ) end end =end
Version data entries
22 entries across 22 versions & 1 rubygems