Sha256: de1989fb6a09a8d957f58a56a1c0ad2269e09d6c764c7cbcc952a950c15230d9
Contents?: true
Size: 355 Bytes
Versions: 13
Compression:
Stored size: 355 Bytes
Contents
class String unless method_defined?(:bytes) # 1.8.7+ # Upacks string into bytes. # # Note, this is not 100% compatible with 1.8.7+ # which returns an enumerator instead of an array. # def bytes(&blk) if block_given? self.unpack('C*').each(&blk) else self.unpack('C*') end end end end
Version data entries
13 entries across 12 versions & 1 rubygems