Sha256: 478d1bedb7f7f19b7764094729e86ab4305cd356f29cd16603686d2b993846f8

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

module Mustang
  module V8
    class String
      # On ruby 1.9+ we have to force UTF-8 encoding here...
      if RUBY_VERSION > "1.9"
        alias_method :native_to_utf8, :to_utf8

        def to_utf8
          native_to_utf8.force_encoding("UTF-8")
        end
      end

      alias_method :to_s, :to_utf8

      include Comparable
      include Delegated

      def <=>(other)
        to_s <=> other
      end

      def delegate
        to_s
      end

      def kind_of?(klass)
        klass == ::String or super(klass)
      end
    end # String
  end # V8
end # Mustang

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mustang-0.2.2 lib/mustang/v8/string.rb