Method: ActionDispatch::Http::URL#port

Defined in:
lib/action_dispatch/http/url.rb

#portObject

Returns the port number of this request as an integer.



45
46
47
48
49
50
51
# File 'lib/action_dispatch/http/url.rb', line 45

def port
  if raw_host_with_port =~ /:(\d+)$/
    $1.to_i
  else
    standard_port
  end
end