Class: RackWebDAV::Handler
- Inherits:
-
Object
- Object
- RackWebDAV::Handler
- Defined in:
- lib/rack-webdav/handler.rb
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
The hash of options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(options = {}) ⇒ Handler
constructor
Initializes a new instance with given options.
Constructor Details
#initialize(options = {}) ⇒ Handler
Initializes a new instance with given options.
17 18 19 20 21 22 |
# File 'lib/rack-webdav/handler.rb', line 17 def initialize( = {}) @options = { :resource_class => FileResource, :root => Dir.pwd }.merge() end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns The hash of options.
6 7 8 |
# File 'lib/rack-webdav/handler.rb', line 6 def @options end |
Instance Method Details
#call(env) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# 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 |