Class: BSON::OrderedHash
- Inherits:
-
Object
- Object
- BSON::OrderedHash
- Defined in:
- lib/rackjson/extensions/BSON/ordered_hash.rb
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
2 3 4 |
# File 'lib/rackjson/extensions/BSON/ordered_hash.rb', line 2 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
6 7 8 |
# File 'lib/rackjson/extensions/BSON/ordered_hash.rb', line 6 def to_json to_h.to_json end |