def serialize(obj)
      begin
        case @serializer
        when :marshal
          Marshal.dump(obj)
        when :json
          obj.to_json
        when :yaml
          YAML.dump(obj)
        end
      rescue => e
        PEROBS.log.fatal "Cannot serialize object as #{@serializer}: " +
          e.message
      end
    end
def serialize(obj)
      begin
        case @serializer
        when :marshal
          Marshal.dump(obj)
        when :json
          obj.to_json
        when :yaml
          YAML.dump(obj)
        end
      rescue => e
        PEROBS.log.fatal "Cannot serialize object as #{@serializer}: " +
          e.message
      end
    end
Serialize the given object using the object serializer.
 @param obj [ObjectBase] Object to serialize
 @return [String] Serialized version