Sha256: 1f83a1dcf3d1b5c14ce3be49061fdb07a5edc9bfc21ff94728e16ee2c8bee263

Contents?: true

Size: 388 Bytes

Versions: 3

Compression:

Stored size: 388 Bytes

Contents

class String

  # Upacks string into bytes.
  #
  def bytes
    self.unpack('C*')
  end

end


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

  require 'test/unit'

  class TestStringBytes < Test::Unit::TestCase
    def test_bytes
      s = "abc"
      assert_equal( s.unpack('C*'), s.bytes )
    end
  end

=end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-1.8.49 lib/facets/core/string/bytes.rb
facets-1.8.51 lib/facets/core/string/bytes.rb
facets-1.8.54 lib/facets/core/string/bytes.rb