Class: Calligraphy::Delete

Inherits:
WebDavRequest show all
Defined in:
lib/calligraphy/delete.rb

Instance Attribute Summary

Attributes inherited from WebDavRequest

#headers, #resource, #response

Instance Method Summary collapse

Methods inherited from WebDavRequest

#initialize

Constructor Details

This class inherits a constructor from Calligraphy::WebDavRequest

Instance Method Details

#requestObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/calligraphy/delete.rb', line 3

def request
  return :locked if @resource.locked_to_user? @headers

  if @resource.collection?
    @resource.delete_collection

    return :no_content
  else
    return :not_found unless @resource.exists?
  end

  return :no_content
end