Sha256: 1f8042dd89d08a1384b7415776eb20383a2a675287005b638d92d6e4c8c0d73f

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 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
    end # String
  end # V8
end # Mustang

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mustang-0.2.1 lib/mustang/v8/string.rb
mustang-0.2.0 lib/mustang/v8/string.rb