lib/berkeley_library/util/uris/validator.rb
# Returns the specified URL as a URI.
# @param url [String, URI] the URL.
# @return [URI] the URI.
# @raise [URI::InvalidURIError] if `url` cannot be parsed as a URI.
Returns the specified URL as a URI.
Returns the specified URL as a URI .
def uri_or_nil(url)
            return unless url
            url.is_a?(URI) ? url : URI.parse(url.to_s)
          end
def uri_or_nil ( url ) return unless url url . is_a? ( URI ) ? url : URI . parse ( url . to_s ) end
Returns the specified URL as a URI.
Returns the specified URL as a URI .
# noinspection RubyMismatchedReturnType
None
URI
[URI::InvalidURIError] if `url` cannot be parsed as a URI.
[ URI :: InvalidURIError ] if ` url ` cannot be parsed as a URI .
url
None