Sha256: ddd3036a197cd8ce638a45444b10129896871574414ccd5e6eabd89e35690f41
Contents?: true
Size: 637 Bytes
Versions: 1
Compression:
Stored size: 637 Bytes
Contents
class Object def utf8! self end def binary! self end end if RUBY_VERSION >= '1.9' class Array def utf8! map { |a| a.utf8! } end def binary! map { |a| a.binary! } end end class Regexp def utf8! Regexp.new(to_s.utf8!) end def binary! Regexp.new(to_s.binary!) end end class Hash def utf8! {}.tap{|h| keys.each { |k| h[k.frozen? ? k.dup.utf8! : k.utf8!] = self[k].utf8! } } end def binary! {}.tap{|h| keys.each { |k| h[k.frozen? ? k.dup.binary! : k.binary!] = self[k].binary! } } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
encoding-kawai-0.3 | lib/encoding-kawai/object.rb |