Class: BSON::OrderedHash
- Inherits:
-
Object
- Object
- BSON::OrderedHash
- Defined in:
- lib/logstash/inputs/mongodb.rb
Overview
def register
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
186 187 188 |
# File 'lib/logstash/inputs/mongodb.rb', line 186 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_json ⇒ Object
190 191 192 |
# File 'lib/logstash/inputs/mongodb.rb', line 190 def to_json JSON.parse(self.to_h.to_json, :allow_nan => true) end |