Module: Webbed::Helpers::EntityHeadersHelper
Overview
Request and Response helper for Entity Headers
Instance Method Summary collapse
-
#content_length ⇒ Fixnum?
The Content-Length of the Entity (as defined in the Content-Length Header).
-
#content_length=(content_length)
Sets the Content-Length of the Entity (as defined in the Content-Length Header).
-
#content_location ⇒ Addressable::URI?
The Content-Location of the Entity (as defined in the Content-Location Header).
-
#content_location=(content_location)
Sets the Content-Location of the Entity (as defined in the Content-Location Header).
-
#content_md5 ⇒ String?
The Content-MD5 of the Entity (as defined in the Content-MD5 Header).
-
#content_md5=(content_md5)
Sets the Content-MD5 of the Entity (as defined in the Content-MD5 Header).
-
#content_type ⇒ MediaType?
The Content-Type of the Entity (as defined in the Content-Type Header).
-
#content_type=(content_type)
Sets the Content-Type of the Entity (as defined in the Content-Type Header).
Instance Method Details
#content_length ⇒ Fixnum?
The Content-Length of the Entity (as defined in the Content-Length Header).
8 9 10 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 8 def content_length headers['Content-Length'] ? headers['Content-Length'].to_i : nil end |
#content_length=(content_length)
Sets the Content-Length of the Entity (as defined in the Content-Length Header).
15 16 17 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 15 def content_length=(content_length) headers['Content-Length'] = content_length.to_s end |
#content_location ⇒ Addressable::URI?
The Content-Location of the Entity (as defined in the Content-Location Header).
22 23 24 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 22 def content_location headers['Content-Location'] ? Addressable::URI.parse(headers['Content-Location']) : nil end |
#content_location=(content_location)
Sets the Content-Location of the Entity (as defined in the Content-Location Header).
29 30 31 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 29 def content_location=(content_location) headers['Content-Location'] = content_location.to_s end |
#content_md5 ⇒ String?
The Content-MD5 of the Entity (as defined in the Content-MD5 Header).
36 37 38 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 36 def content_md5 headers['Content-MD5'] end |
#content_md5=(content_md5)
Sets the Content-MD5 of the Entity (as defined in the Content-MD5 Header).
43 44 45 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 43 def content_md5=(content_md5) headers['Content-MD5'] = content_md5 end |
#content_type ⇒ MediaType?
The Content-Type of the Entity (as defined in the Content-Type Header).
50 51 52 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 50 def content_type headers['Content-Type'] ? Webbed::MediaType.new(headers['Content-Type']) : nil end |
#content_type=(content_type)
Sets the Content-Type of the Entity (as defined in the Content-Type Header).
57 58 59 |
# File 'lib/webbed/helpers/entity_headers_helper.rb', line 57 def content_type=(content_type) headers['Content-Type'] = content_type.to_s end |