Module: Webbed::Helpers::RequestHeadersHelper
- Included in:
- Request
- Defined in:
- lib/webbed/helpers/request_headers_helper.rb
Overview
Request helper for Request Headers
Instance Method Summary collapse
-
#from ⇒ String?
The From email of the Request (as defined in the From Header).
-
#from=(from)
Sets the From email of the Request (as defined in the From Header).
-
#host ⇒ String?
The Host of the Request (as defined in the Host Header).
-
#host=(host)
Sets the Host of the Request (as defined in the Host Header).
-
#max_forwards ⇒ Fixnum?
The Max-Forwards of the Request (as defined in the Max-Forwards Header).
-
#max_forwards=(max_forwards)
Sets the Max-Forwards of the Request (as defined in the Max-Forwards Header).
-
#referer ⇒ Addressable::URI?
The Referer of the Request (as defined in the Referer Header).
-
#referer=(referer)
Sets the Referer of the Request (as defined in the Referer Header).
Instance Method Details
#from ⇒ String?
The From email of the Request (as defined in the From Header)
22 23 24 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 22 def from headers['From'] end |
#from=(from)
Sets the From email of the Request (as defined in the From Header)
29 30 31 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 29 def from=(from) headers['From'] = from end |
#host ⇒ String?
The Host of the Request (as defined in the Host Header)
8 9 10 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 8 def host headers['Host'] end |
#host=(host)
Sets the Host of the Request (as defined in the Host Header)
15 16 17 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 15 def host=(host) headers['Host'] = host end |
#max_forwards ⇒ Fixnum?
The Max-Forwards of the Request (as defined in the Max-Forwards Header)
36 37 38 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 36 def max_forwards headers['Max-Forwards'] ? headers['Max-Forwards'].to_i : nil end |
#max_forwards=(max_forwards)
Sets the Max-Forwards of the Request (as defined in the Max-Forwards Header)
43 44 45 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 43 def max_forwards=(max_forwards) headers['Max-Forwards'] = max_forwards.to_s end |
#referer ⇒ Addressable::URI?
The Referer of the Request (as defined in the Referer Header)
50 51 52 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 50 def referer headers['Referer'] ? Addressable::URI.parse(headers['Referer']) : nil end |
#referer=(referer)
Sets the Referer of the Request (as defined in the Referer Header)
57 58 59 |
# File 'lib/webbed/helpers/request_headers_helper.rb', line 57 def referer=(referer) headers['Referer'] = referer.to_s end |