class Swagger::Data::Url

Constants

SCHEMES

Attributes

url[R]

Public Class Methods

new(url) click to toggle source
# File lib/ruby-swagger/data/url.rb, line 9
def initialize(url)
  @url = url
end

Public Instance Methods

to_swagger() click to toggle source
# File lib/ruby-swagger/data/url.rb, line 20
def to_swagger
  url
end
valid?() click to toggle source
# File lib/ruby-swagger/data/url.rb, line 13
def valid?
  parsed = Addressable::URI.parse(url) or return false
  SCHEMES.include?(parsed.scheme)
rescue Addressable::URI::InvalidURIError
  false
end