Sha256: c6dd2eed3b7fc6d7ea3f24bc76b7397ee47f33fb7221a13f2d7d58a47fb01c9d

Contents?: true

Size: 524 Bytes

Versions: 10

Compression:

Stored size: 524 Bytes

Contents

#--
# CREDIT Thomas Sawyer
#++

class Symbol

  # Just like String#chomp.
  #
  def chomp(seperator=nil)
    to_s.chomp(seperator.to_s).to_sym
  end

  # Just like String#lchomp.
  #
  def lchomp(str)
    to_s.reverse.chomp(str).reverse.to_sym
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TestSymbol < Test::Unit::TestCase

    def test_chomp
      assert_equal( :a, :ab.chomp(:b) )
    end

  end

=end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.0.1 lib/core/facets/symbol/chomp.rb
facets-2.0.0 lib/core/facets/symbol/chomp.rb
facets-2.0.2 lib/core/facets/symbol/chomp.rb
facets-2.0.5 lib/core/facets/symbol/chomp.rb
facets-2.1.0 lib/core/facets/symbol/chomp.rb
facets-2.1.1 lib/core/facets/symbol/chomp.rb
facets-2.1.2 lib/core/facets/symbol/chomp.rb
facets-2.0.3 lib/core/facets/symbol/chomp.rb
facets-2.0.4 lib/core/facets/symbol/chomp.rb
facets-2.1.3 lib/core/facets/symbol/chomp.rb