class MarkLogic::ObjectId

Public Class Methods

from_string(str) click to toggle source
# File lib/marklogic/object_id.rb, line 21
def from_string(str)
  object_id = allocate
  object_id.instance_variable_set(:@id, str)
  object_id
end
new() click to toggle source
# File lib/marklogic/object_id.rb, line 8
def initialize
  @id = SecureRandom.hex
end

Public Instance Methods

==(other) click to toggle source
# File lib/marklogic/object_id.rb, line 32
def ==(other)
  to_s == other.to_s
end
as_json(options=nil) click to toggle source
# File lib/marklogic/object_id.rb, line 36
def as_json(options=nil)
  to_s
end
hash() click to toggle source
# File lib/marklogic/object_id.rb, line 44
def hash
  to_s.hash
end
inspect() click to toggle source
# File lib/marklogic/object_id.rb, line 16
def inspect
  "#<#{self.class}('#{@id}')>"
end
to_json(options = nil) click to toggle source
# File lib/marklogic/object_id.rb, line 40
def to_json(options = nil)
  as_json.to_json
end
to_s() click to toggle source
# File lib/marklogic/object_id.rb, line 12
def to_s
  @id
end
Also aliased as: to_str
to_str()
Alias for: to_s