Class: Calligraphy::Copy

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

Direct Known Subclasses

Move

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
16
17
# File 'lib/calligraphy/copy.rb', line 3

def request
  options = copy_move_options
  can_copy = @resource.can_copy? options

  if can_copy[:ancestor_exist]
    return :precondition_failed
  else
    return :conflict
  end unless can_copy[:can_copy]

  return :locked if can_copy[:locked]

  overwritten = @resource.copy options
  return overwritten ? :no_content : :created
end