Sha256: 6f3ddd5aa8e8a06263cdef0aeb97b58620221f7b72b4cc2235a157a73bf86729

Contents?: true

Size: 668 Bytes

Versions: 140

Compression:

Stored size: 668 Bytes

Contents

module MessagePack
  class Unpacker
    # see ext for other methods

    def registered_types
      list = []

      registered_types_internal.each_pair do |type, ary|
        list << {type: type, class: ary[0], unpacker: ary[2]}
      end

      list.sort{|a, b| a[:type] <=> b[:type] }
    end

    def type_registered?(klass_or_type)
      case klass_or_type
      when Class
        klass = klass_or_type
        registered_types.any?{|entry| klass == entry[:class] }
      when Integer
        type = klass_or_type
        registered_types.any?{|entry| type == entry[:type] }
      else
        raise ArgumentError, "class or type id"
      end
    end
  end
end

Version data entries

140 entries across 140 versions & 3 rubygems

Version Path
msgpack-1.6.0-java lib/msgpack/unpacker.rb
msgpack-1.6.0 lib/msgpack/unpacker.rb
msgpack-1.5.6-java lib/msgpack/unpacker.rb
msgpack-1.5.6 lib/msgpack/unpacker.rb
msgpack-1.5.5-java lib/msgpack/unpacker.rb
msgpack-1.5.5 lib/msgpack/unpacker.rb
msgpack-1.5.4-java lib/msgpack/unpacker.rb
msgpack-1.5.4 lib/msgpack/unpacker.rb
msgpack-1.5.3-java lib/msgpack/unpacker.rb
msgpack-1.5.3 lib/msgpack/unpacker.rb
msgpack-1.5.2-java lib/msgpack/unpacker.rb
msgpack-1.5.2 lib/msgpack/unpacker.rb
msgpack-1.5.1-java lib/msgpack/unpacker.rb
msgpack-1.5.1 lib/msgpack/unpacker.rb
msgpack-1.5.0-java lib/msgpack/unpacker.rb
msgpack-1.5.0 lib/msgpack/unpacker.rb
msgpack-1.4.5-java lib/msgpack/unpacker.rb
msgpack-1.4.5 lib/msgpack/unpacker.rb
msgpack-1.4.4-java lib/msgpack/unpacker.rb
msgpack-1.4.4 lib/msgpack/unpacker.rb