Class: Calligraphy::Proppatch
- Inherits:
-
WebDavRequest
- Object
- WebDavRequest
- Calligraphy::Proppatch
- Includes:
- XML::Utils
- Defined in:
- lib/calligraphy/web_dav_request/proppatch.rb
Overview
Responsible for processing instructions specified in the request body to set and/or remove properties defined on the resource.
Instance Attribute Summary
Attributes inherited from WebDavRequest
#headers, #request, #resource, #response
Instance Method Summary collapse
-
#execute ⇒ Object
Executes the WebDAV request for a particular resource.
Methods included from XML::Utils
Methods inherited from WebDavRequest
Constructor Details
This class inherits a constructor from Calligraphy::WebDavRequest
Instance Method Details
#execute ⇒ Object
Executes the WebDAV request for a particular resource.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/calligraphy/web_dav_request/proppatch.rb', line 10 def execute return :locked if @resource.locked_to_user? @headers # The `propertyupdate` tag contains the request to alter properties # on a resource. xml = xml_for body: body, node: 'propertyupdate' return :bad_request if xml == :bad_request actions = @resource.proppatch xml builder = xml_builder xml_res = builder.proppatch_response(@resource.full_request_path, actions) set_xml_content_type [:multi_status, xml_res] end |