Method: FellowshipOne::ApiWriter#delete_object

Defined in:
lib/writers/api_writer.rb

#delete_objectObject

Deletes this object.

Returns:

  • True or ID on success, otherwise false.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/writers/api_writer.rb', line 41

def delete_object
  success = true

  if @url_data_delete_path.nil?
    @error_messages = ["DELETE not implemented for #{self.class.to_s}"]
    return false
  end

  begin
    # @url_data_path should be the same as :put if this object is already
    # setup and mapped to an object that exists
    response = FellowshipOne::api_request(:delete, @url_data_delete_path)
    success = response.code == 204 ? true : false # No content but is a success
  rescue Exception => e  
    @error_messages = e.message.split(',')
    success = false
  end 

  return success
end