Class: Openapi3Parser::Validators::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi3_parser/validators/url.rb

Class Method Summary collapse

Class Method Details

.call(input) ⇒ Object


6
7
8
9
10
# File 'lib/openapi3_parser/validators/url.rb', line 6

def self.call(input)
  URI.parse(input) && nil
rescue URI::InvalidURIError
  %("#{input}" is not a valid URL)
end