Class: BSON::OrderedHash

Inherits:
Object
  • Object
show all
Defined in:
lib/backups/ext/ordered_hash.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



3
4
5
# File 'lib/backups/ext/ordered_hash.rb', line 3

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



7
8
9
# File 'lib/backups/ext/ordered_hash.rb', line 7

def to_json
  to_h.to_json
end