Class: Synapse::Serialization::OrderedHashToHashConverter

Inherits:
Object
  • Object
show all
Includes:
Converter
Defined in:
lib/synapse/serialization/converter/bson.rb

Overview

Converter that converts an ordered hash from BSON into a regular Ruby hash

Instance Method Summary collapse

Instance Method Details

#convert_content(original) ⇒ Object

Parameters:

  • original (Object)

Returns:

  • (Object)


11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/synapse/serialization/converter/bson.rb', line 11

def convert_content(original)
  converted = Hash.new

  original.each do |key, value|
    if value.is_a? BSON::OrderedHash
      value = convert_content value
    end

    converted[key] = value
  end

  converted
end