Sha256: ec1663150d694afe0d3bd8466ceeb1baa71327d817ab68b2eced821ddc2458c5

Contents?: true

Size: 648 Bytes

Versions: 26

Compression:

Stored size: 648 Bytes

Contents

class Symbol

  # Symbol's really are just simplified strings.
  # Thus #to_str seems quite reasonable.
  # This uses the Kernal#String method.
  #--
  # Maybe just change to #to_s?
  # BTW: This would be lots faster, I bet, if implemented in core.
  #++
  def to_str
    String( self )
  end

end



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

  require 'test/unit'

  class TCSymbol < Test::Unit::TestCase

    def test_to_str
      assert_equal( "a", :a.to_str )
      assert_equal( "abc", :abc.to_str )
      assert_equal( '#$%', :'#$%'.to_str )
    end

  end

=end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
facets-1.0.0 lib/facet/symbol/to_str.rb
facets-0.9.0 lib/nano/symbol/to_str.rb
facets-1.0.3 packages/core/lib/facet/symbol/to_str.rb
facets-1.2.1 lib/facets/core/symbol/to_str.rb
facets-1.2.0 lib/facets/core/symbol/to_str.rb
facets-1.3.0 lib/facets/core/symbol/to_str.rb
facets-1.1.0 lib/facet/symbol/to_str.rb
facets-1.3.1 lib/facets/core/symbol/to_str.rb
facets-1.3.3 lib/facets/core/symbol/to_str.rb
facets-1.3.2 lib/facets/core/symbol/to_str.rb
facets-1.4.1 lib/facets/core/symbol/to_str.rb
facets-1.4.0 lib/facets/core/symbol/to_str.rb
facets-1.4.2 lib/facets/core/symbol/to_str.rb
facets-1.4.3 lib/facets/core/symbol/to_str.rb
facets-1.4.4 lib/facets/core/symbol/to_str.rb
facets-1.4.5 lib/facets/core/symbol/to_str.rb
facets-1.7.0 lib/facets/core/symbol/to_str.rb
facets-1.7.30 lib/facets/core/symbol/to_str.rb
facets-1.7.38 lib/facets/core/symbol/to_str.rb
facets-1.7.46 lib/facets/core/symbol/to_str.rb