method
check_port
v1_9_1_378 -
Show latest stable
- Class:
URI::Generic
check_port(v)private
No documentation available.
# File lib/uri/generic.rb, line 407
def check_port(v)
return v unless v
if @registry || @opaque
raise InvalidURIError,
"can not set port with registry or opaque"
elsif !v.kind_of?(Fixnum) && @parser.regexp[:PORT] !~ v
raise InvalidComponentError,
"bad component(expected port component): #{v}"
end
return true
end