Module: Async::Caldav::Handlers::Put

Defined in:
lib/async/caldav/handlers/put.rb

Class Method Summary collapse

Class Method Details

.call(path:, body:, storage:, headers: {}, resource_type: nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/async/caldav/handlers/put.rb', line 9

def call(path:, body:, storage:, headers: {}, resource_type: nil, **)
  rejected = rejection(body, resource_type)
  if rejected
    rejected
  else
    content_type = headers['content-type'] || default_content_type(resource_type)
    store(
      path,
      body,
      content_type,
      storage,
      headers,
    )
  end
end