Add WebDavRequest

This commit is contained in:
Brandon Robins
2017-10-22 23:25:25 -05:00
parent cab55272ca
commit e64cb55c5d
2 changed files with 39 additions and 0 deletions

8
lib/calligraphy.rb Normal file
View File

@@ -0,0 +1,8 @@
require 'calligraphy/web_dav_request'
require 'calligraphy/xml/builder'
require 'calligraphy/xml/namespace'
require 'calligraphy/xml/node'
module Calligraphy
end

View File

@@ -0,0 +1,31 @@
module Calligraphy
class WebDavRequest
attr_accessor :resource, :response
attr_reader :headers, :request
def initialize(headers:, request:, response:, resource:)
@headers = headers
@request = request
@response = response
@resource = resource
end
def request
raise NotImplemented
end
private
def body
@resource.request_body
end
def set_xml_content_type
@response.content_type = 'application/xml'
end
def xml_builder
Calligraphy::XML::Builder.new server_protocol: @request.env['SERVER_PROTOCOL']
end
end
end