module BSON::JSON

Provides common behaviour for JSON serialization of objects.

@since 2.0.0

Public Instance Methods

to_json(*args) click to toggle source

Converting an object to JSON simply gets it’s hash representation via as_json, then converts it to a string.

@example Convert the object to JSON

object.to_json

@note All types must implement as_json.

@return [ String ] The object as JSON.

@since 2.0.0

# File lib/bson/json.rb, line 34
def to_json(*args)
  as_json.to_json(*args)
end