Class: Boar::Handlers::Hosts
- Defined in:
- app/models/boar/handlers/hosts.rb
Instance Attribute Summary
Attributes inherited from Generic
Instance Method Summary collapse
- #call(request, domain = nil, port = nil) ⇒ Object
-
#initialize(*args) ⇒ Hosts
constructor
A new instance of Hosts.
Methods included from Utils::Basic
#ensure_hash, #get_option, #interpolate
Constructor Details
#initialize(*args) ⇒ Hosts
Returns a new instance of Hosts.
10 11 |
# File 'app/models/boar/handlers/hosts.rb', line 10 def initialize(*args) end |
Instance Method Details
#call(request, domain = nil, port = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/boar/handlers/hosts.rb', line 13 def call(request, domain = nil, port = nil) domain ||= request.domain port ||= request.port rv = [domain, port].join(":") if rv == "localhost:3000" then rv = "localhost" elsif ["http/80", "https/443"].include?([request.protocol, request.port].join("/")) then rv = request.domain end rv end |