lib/rest/delete.rb
  Deletes the specified class and returns true on success
  todo: remove all instances of the class
Deletes the specified class and returns true on success
todo: remove all instances of the class
Deletes the specified class and returns true on success todo : remove all instances of the class
def delete_class o_class
    cl = classname(o_class)
    return if cl.nil?
    logger.progname = 'RestDelete#DeleteClass'
    begin
      response = @res["/class/#{ActiveOrient.database}/#{cl}"].delete
      if response.code == 204
	logger.info{"Class #{cl} deleted."}
	ActiveOrient.database_classes.delete(cl)
      end
    rescue RestClient::InternalServerError => e
      sentence=  JSON.parse( e.response)['errors'].last['content']
      if ActiveOrient.database_classes.has_key? cl
	logger.error{"Class #{cl} still present."}
	logger.error{ sentence }
	false
      else
	logger.error{e.inspect}
	true
      end
    rescue Exception => e
      logger.error{e.message}
      logger.error{e.inspect}
    end
  end
def delete_class o_class cl = classname ( o_class ) return if cl . nil? logger . progname = 'RestDelete#DeleteClass' begin response = @res [ "/class/#{ActiveOrient.database}/#{cl}" ] . delete if response . code == 204 logger . info { "Class #{cl} deleted." } ActiveOrient . database_classes . delete ( cl ) end rescue RestClient :: InternalServerError => e sentence = JSON . parse ( e . response ) [ 'errors' ] . last [ 'content' ] if ActiveOrient . database_classes . has_key? cl logger . error { "Class #{cl} still present." } logger . error { sentence } false else logger . error { e . inspect } true end rescue Exception => e logger . error { e . message } logger . error { e . inspect } end end
Deletes the specified class and returns true on success
todo: remove all instances of the class
Deletes the specified class and returns true on success todo : remove all instances of the class
## to do: if cl contains special characters, enclose with backticks
o_class
<not_specific>