Sha256: 7f6c0c3164e759b9d1b0844fd23ebc42888b42285ceed2a2c2208e36c9a5b01f
Contents?: true
Size: 665 Bytes
Versions: 26
Compression:
Stored size: 665 Bytes
Contents
class Symbol # Successor method for symobol. This simply converts # the symbol to a string uses String#succ and then # converts it back to a symbol. # # :a.succ => :b # #-- # In the future I would like this to work more like # a simple chracerter dial. #++ def succ self.to_s.succ.intern end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCSymbol < Test::Unit::TestCase def test_succ assert_equal( :b, :a.succ ) assert_equal( :aab, :aaa.succ ) assert_equal( :"2", :"1".succ ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems