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