class JobDispatch::Identity
Identity
encapsulates a ZeroMQ socket identity, which is a string of binary characters, typically containing nulls or non-utf8 compatible characters in ASCII-8BIT encoding.
Attributes
identity[R]
Public Class Methods
new(identity)
click to toggle source
# File lib/job_dispatch/identity.rb, line 13 def initialize(identity) @identity = identity.to_sym end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/job_dispatch/identity.rb, line 49 def <=>(other) @identity <=> other.identity end
==(other)
click to toggle source
# File lib/job_dispatch/identity.rb, line 41 def ==(other) @identity == other.identity end
as_json(options={})
click to toggle source
# File lib/job_dispatch/identity.rb, line 29 def as_json(options={}) to_hex.as_json(options) end
eql?(other)
click to toggle source
# File lib/job_dispatch/identity.rb, line 45 def eql?(other) self.class == other.class && @identity == other.identity end
hash()
click to toggle source
# File lib/job_dispatch/identity.rb, line 37 def hash @identity.hash end
to_hex()
click to toggle source
# File lib/job_dispatch/identity.rb, line 25 def to_hex @identity.to_s.bytes.map { |x| '%02x' % x }.join end
to_s()
click to toggle source
# File lib/job_dispatch/identity.rb, line 17 def to_s @identity.to_s end
to_str()
click to toggle source
# File lib/job_dispatch/identity.rb, line 21 def to_str @identity.to_str end
to_sym()
click to toggle source
# File lib/job_dispatch/identity.rb, line 33 def to_sym @identity end