Module: BSON::JSON
- Included in:
- Binary, Code, CodeWithScope, DBRef, DbPointer, Decimal128, Int32, Int64, MaxKey, MinKey, ObjectId, Regexp, Regexp::Raw, Symbol::Raw, Timestamp, Undefined
- Defined in:
- lib/bson/json.rb
Overview
Provides common behaviour for JSON serialization of objects.
Instance Method Summary collapse
-
#to_json(*args) ⇒ String
Converting an object to JSON simply gets it’s hash representation via as_json, then converts it to a string.
Instance Method Details
#to_json(*args) ⇒ String
Note:
All types must implement as_json.
Converting an object to JSON simply gets it’s hash representation via as_json, then converts it to a string.
35 36 37 |
# File 'lib/bson/json.rb', line 35 def to_json(*args) as_json.to_json(*args) end |