Class: Calligraphy::Mkcol

Inherits:
WebDavRequest show all
Defined in:
lib/calligraphy/mkcol.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
# File 'lib/calligraphy/mkcol.rb', line 3

def request
  return :method_not_allowed if @resource.exists?
  return :conflict unless @resource.ancestor_exist?
  return :unsupported_media_type unless @resource.request_body.blank?

  @resource.create_collection
  set_content_location_header

  return :created
end