Class: BSON::ObjectId

Inherits:
Object show all
Defined in:
lib/frecon/base/bson.rb

Overview

Public: A monkey-patch for the BSON::ObjectId class which introduces an #as_json method.

Instance Method Summary collapse

Instance Method Details

#as_json(*args) ⇒ Object

Public: Get produce a JSON representation of this ObjectId.

Since we don’t want to produce a JSON Object for every ID, this method instead just returns the String _id value within this object.

Returns a String containing the value of this ObjectId.



24
25
26
# File 'lib/frecon/base/bson.rb', line 24

def as_json(*args)
	to_s
end