Module: Webbed::Helpers::ResponseHeadersHelper

Included in:
Response
Defined in:
lib/webbed/helpers/response_headers_helper.rb

Overview

Response helper for Response Headers

Instance Method Summary collapse

Instance Method Details

#ageFixnum?

The Age of the Response (as defined in the Age Header)

Returns:

  • (Fixnum, nil)


22
23
24
# File 'lib/webbed/helpers/response_headers_helper.rb', line 22

def age
  headers['Age'] ? headers['Age'].to_i : nil
end

#age=(age)

Sets the Age of the Response (as defined in the Age Header)

Parameters:

  • age (#to_s)


29
30
31
# File 'lib/webbed/helpers/response_headers_helper.rb', line 29

def age=(age)
  headers['Age'] = age.to_s
end

#etagString?

The ETag of the Response (as defined in the ETag Header)

Returns:

  • (String, nil)


8
9
10
# File 'lib/webbed/helpers/response_headers_helper.rb', line 8

def etag
  headers['ETag']
end

#etag=(etag)

Sets the ETag of the Response (as defined in the ETag Header)

Parameters:

  • etag (String)


15
16
17
# File 'lib/webbed/helpers/response_headers_helper.rb', line 15

def etag=(etag)
  headers['ETag'] = etag
end

#locationAddressable::URI?

The Location of the Response (as defined in the Location Header)

Returns:

  • (Addressable::URI, nil)


36
37
38
# File 'lib/webbed/helpers/response_headers_helper.rb', line 36

def location
  headers['Location'] ? Addressable::URI.parse(headers['Location']) : nil
end

#location=(location)

Sets the Location of the Response (as defined in the Location Header)

Parameters:

  • location (#to_s)


43
44
45
# File 'lib/webbed/helpers/response_headers_helper.rb', line 43

def location=(location)
  headers['Location'] = location.to_s
end