def finish
      retval = {}
      # Ensure all required attributes have been set
      @attributes.each do |attr|
        val = instance_variable_get "@#{attr}"
        raise ArgumentError, "Missing attribute #{attr}" if val.nil?
        retval[attr] = val
      end
      retval
    end
def finish
      retval = {}
      # Ensure all required attributes have been set
      @attributes.each do |attr|
        val = instance_variable_get "@#{attr}"
        raise ArgumentError, "Missing attribute #{attr}" if val.nil?
        retval[attr] = val
      end
      retval
    end
Return a hash after verifying everything was set correctly