class Erlang::OtpErlangReference

Attributes

creation[R]
id[R]
node[R]

Public Class Methods

new(node, id, creation) click to toggle source
# File lib/erlang.rb, line 242
def initialize(node, id, creation)
    @node = node
    @id = id
    @creation = creation
end

Public Instance Methods

==(other) click to toggle source
# File lib/erlang.rb, line 278
def ==(other)
    return binary == other.binary
end
Also aliased as: eql?
binary() click to toggle source
# File lib/erlang.rb, line 250
def binary
    length = @id.bytesize / 4
    if length == 0
        return "#{TAG_REFERENCE_EXT.chr}" \
               "#{@node.binary}#{@id}#{@creation}"
    elsif length <= 65535
        length_packed = [length].pack('n')
        creation_size = @creation.bytesize
        if creation_size == 1
            return "#{TAG_NEW_REFERENCE_EXT.chr}#{length_packed}" \
                   "#{@node.binary}#{@creation}#{@id}"
        elsif creation_size == 4
            return "#{TAG_NEWER_REFERENCE_EXT.chr}#{length_packed}" \
                   "#{@node.binary}#{@creation}#{@id}"
        else
            raise OutputException, 'unknown reference type', caller
        end
    else
        raise OutputException, 'uint16 overflow', caller
    end
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/erlang.rb, line 275
def hash
    return binary.hash
end
to_s() click to toggle source
# File lib/erlang.rb, line 271
def to_s
    return "#{self.class.name}" \
           "('#{@node.to_s}','#{@id.to_s}','#{@creation.to_s}')"
end