class RackWebDAV::Handler
Attributes
options[R]
@return [Hash] The hash of options.
Public Class Methods
new(options = {})
click to toggle source
Initializes a new instance with given options.
@param [Hash] options Hash of options to customize the handler behavior. @option options [Class] :resource_class (FileResource
)
The resource class.
@option options [String] :root (“.”)
The root resource folder.
# File lib/rack-webdav/handler.rb, line 17 def initialize(options = {}) @options = { :resource_class => FileResource, :root => Dir.pwd }.merge(options) end
Public Instance Methods
call(env)
click to toggle source
# File lib/rack-webdav/handler.rb, line 24 def call(env) request = Rack::Request.new(env) response = Rack::Response.new begin controller = Controller.new(request, response, @options) controller.send(request.request_method.downcase) rescue HTTPStatus::Status => status response.status = status.code end response.finish end