class BSON::Undefined
Represents the Undefined
BSON
type
@see bsonspec.org/#/specification
@since 2.0.0
Constants
Public Instance Methods
Source
# File lib/bson/undefined.rb, line 43 def ==(other) self.class == other.class end
Determine if undefined is equal to another object.
@example Check undefined equality.
BSON::Undefined.new == object
@param [ Object
] other The object to check against.
@return [ true, false ] If the objects are equal.
@since 2.0.0
Source
# File lib/bson/undefined.rb, line 66 def as_extended_json(**options) { "$undefined" => true } end
Converts this object to a representation directly serializable to Extended JSON
(github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md).
@option opts [ nil | :relaxed | :legacy ] :mode Serialization mode
(default is canonical extended JSON)
@return [ Hash
] The extended json representation.
Source
# File lib/bson/undefined.rb, line 55 def as_json(*args) nil end
Return a string representation of the BSON::Undefined
for use in application-level JSON
serialization. This method is intentionally different from as_extended_json
.
@example Get the undefined as a JSON-serializable object.
undefined.as_json
@return [ nil ] The undefined as nil.