Class: Openapi3Parser::Validators::AbsoluteUri

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

Class Method Summary collapse

Class Method Details

.call(input) ⇒ Object



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

def self.call(input)
  uri = URI.parse(input)
  %("#{input}" is not a absolute URI) unless uri.absolute?
rescue URI::InvalidURIError
  %("#{input}" is not a valid URI)
end