Method: Mongo3::Node#to_json

Defined in:
lib/mongo3/node.rb

#to_json(*a) ⇒ Object

converts to json



80
81
82
83
84
85
86
87
# File 'lib/mongo3/node.rb', line 80

def to_json(*a)
  hash = BSON::OrderedHash.new
  hash[:id]       = oid
  hash[:name]     = self.name
  hash[:children] = self.children
  hash[:data]     = self.data 
  hash.to_json(*a)
end