Module: Webbed::Helpers::SchemeHelper
- Included in:
- Request
- Defined in:
- lib/webbed/helpers/scheme_helper.rb
Overview
Request helper for the schemes
Instance Method Summary collapse
-
#default_port ⇒ Fixnum?
The default port for the designated scheme.
-
#secure? ⇒ Boolean
Whether or not the request was sent securely (using HTTPS).
Instance Method Details
#default_port ⇒ Fixnum?
The default port for the designated scheme
This method returns 80
if you're using HTTP and 443
if you're using
HTTPS.
18 19 20 21 22 23 |
# File 'lib/webbed/helpers/scheme_helper.rb', line 18 def default_port case scheme when 'http' then 80 when 'https' then 443 end end |
#secure? ⇒ Boolean
Whether or not the request was sent securely (using HTTPS)
8 9 10 |
# File 'lib/webbed/helpers/scheme_helper.rb', line 8 def secure? scheme == 'https' end |