Class: BSON::Undefined
- Inherits:
-
Object
- Object
- BSON::Undefined
- Includes:
- JSON, Specialized
- Defined in:
- lib/bson/undefined.rb
Overview
Represents the Undefined BSON type
Constant Summary collapse
- BSON_TYPE =
Undefined is type 0x06 in the BSON spec.
::String.new(6.chr, encoding: BINARY).freeze
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Determine if undefined is equal to another object.
-
#as_extended_json(**options) ⇒ Hash
Converts this object to a representation directly serializable to Extended JSON (github.com/mongodb/specifications/blob/master/source/extended-json.rst).
-
#as_json(*args) ⇒ nil
Return a string representation of the BSON::Undefined for use in application-level JSON serialization.
Methods included from Specialized
Methods included from JSON
Instance Method Details
#==(other) ⇒ true, false
Determine if undefined is equal to another object.
43 44 45 |
# File 'lib/bson/undefined.rb', line 43 def ==(other) self.class == other.class end |
#as_extended_json(**options) ⇒ Hash
Converts this object to a representation directly serializable to Extended JSON (github.com/mongodb/specifications/blob/master/source/extended-json.rst).
66 67 68 |
# File 'lib/bson/undefined.rb', line 66 def as_extended_json(**) { "$undefined" => true } end |
#as_json(*args) ⇒ nil
Return a string representation of the BSON::Undefined for use in application-level JSON serialization. This method is intentionally different from #as_extended_json.
55 56 57 |
# File 'lib/bson/undefined.rb', line 55 def as_json(*args) nil end |