Class: BSON::OrderedHash

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/inputs/mongodb.rb

Overview

def register

Instance Method Summary collapse

Instance Method Details

#to_hObject



220
221
222
# File 'lib/logstash/inputs/mongodb.rb', line 220

def to_h
  inject({}) { |acc, element| k,v = element; acc[k] = (if v.class == BSON::OrderedHash then v.to_h else v end); acc }
end

#to_jsonObject



224
225
226
# File 'lib/logstash/inputs/mongodb.rb', line 224

def to_json
  JSON.parse(self.to_h.to_json, :allow_nan => true)
end