Skip to content

Commit

Permalink
Ensure stubbed properties set the proper status code.
Browse files Browse the repository at this point in the history
By raising an exception (HTTPStatus derived class) the renderer will
generate an empty tag and attach it to the proper HTTP status.  Merely
returning the error code will cause the renderer to create a tag with
the textual contents being the HTTPStatus class.
  • Loading branch information
inferiorhumanorgans committed Apr 6, 2012
1 parent 5c33b00 commit 509c405
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/dav4rack/resource.rb
Expand Up @@ -140,22 +140,23 @@ def parent_exists?

# Return the creation time.
def creation_date
NotImplemented
raise NotImplemented
end

# Return the time of last modification.
def last_modified
NotImplemented
raise NotImplemented
end

# Set the time of last modification.
def last_modified=(time)
NotImplemented
# Is this correct?
raise NotImplemented
end

# Return an Etag, an unique hash value for this resource.
def etag
NotImplemented
raise NotImplemented
end

# Return the resource type. Generally only used to specify
Expand All @@ -166,12 +167,12 @@ def resource_type

# Return the mime type of this resource.
def content_type
NotImplemented
raise NotImplemented
end

# Return the size in bytes for this resource.
def content_length
NotImplemented
raise NotImplemented
end

# HTTP GET request.
Expand Down

0 comments on commit 509c405

Please sign in to comment.