Module: Sinatra::WebDAV::Request

Defined in:
lib/sinatra/webdav.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/sinatra/webdav.rb', line 39

def self.included(base)
  base.class_eval do
    alias_method :_safe?, :safe?
    alias_method :_idempotent?, :idempotent?

    def safe?
      _safe? or propfind?
    end

    def idempotent?
      _idempotent? or propfind? or move? or unlock? # or lock?
    end
  end
end

Instance Method Details

#copy?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/sinatra/webdav.rb', line 66

def copy?
  request_method == 'COPY'
end

#mkcol?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/sinatra/webdav.rb', line 62

def mkcol?
  request_method == 'MKCOL'
end

#move?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/sinatra/webdav.rb', line 70

def move?
  request_method == 'MOVE'
end

#propfind?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/sinatra/webdav.rb', line 54

def propfind?
  request_method == 'PROPFIND'
end

#proppatch?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/sinatra/webdav.rb', line 58

def proppatch?
  request_method == 'PROPPATCH'
end

#unlock?Boolean

def lock?

request_method == 'LOCK'

end

Returns:

  • (Boolean)


78
79
80
# File 'lib/sinatra/webdav.rb', line 78

def unlock?
  request_method == 'UNLOCK'
end