require "json"

module SimpleQueues
  class JsonEncoder
    def encode(message)
      JSON.generate(message)
    end

    def decode(message)
      JSON.parse(message)
    end
  end
end

require "json"

module SimpleQueues
  class JsonEncoder
    def encode(message)
      message.to_json
    end

    def decode(message)
      JSON.parse(message)
    end
  end
end

Fix 'NoMethodError merge for JSON::Ext::Generator::State'
Fix 'NoMethodError merge for JSON::Ext::Generator::State'

See http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/3739dd637e038fa9
And http://stackoverflow.com/questions/4934917/rails-json-conversion-error
