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.
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 |