Module: BSON::Object
- Defined in:
- lib/bson/object.rb
Overview
Injects behaviour for all Ruby objects.
Instance Method Summary collapse
-
#to_bson_key(encoded = ''.force_encoding(BINARY)) ⇒ Object
Objects that don’t override this method will raise an error when trying to use them as keys in a BSON document.
-
#to_bson_normalized_key ⇒ Object
Converts the object to a normalized key in a BSON document.
-
#to_bson_normalized_value ⇒ Object
Converts the object to a normalized value in a BSON document.
Instance Method Details
#to_bson_key(encoded = ''.force_encoding(BINARY)) ⇒ Object
Objects that don’t override this method will raise an error when trying to use them as keys in a BSON document. This is only overridden in String and Symbol.
34 35 36 |
# File 'lib/bson/object.rb', line 34 def to_bson_key(encoded = ''.force_encoding(BINARY)) raise InvalidKey.new(self) end |
#to_bson_normalized_key ⇒ Object
Converts the object to a normalized key in a BSON document.
46 47 48 |
# File 'lib/bson/object.rb', line 46 def to_bson_normalized_key self end |
#to_bson_normalized_value ⇒ Object
Converts the object to a normalized value in a BSON document.
58 59 60 |
# File 'lib/bson/object.rb', line 58 def to_bson_normalized_value self end |