Class: Jschematic::Attributes::Format::Uri

Inherits:
Object
  • Object
show all
Includes:
Element
Defined in:
lib/jschematic/attributes/format.rb

Instance Attribute Summary

Attributes included from Element

#id, #parent

Instance Method Summary collapse

Methods included from Element

#required?, #schema_for, #title, #to_s

Instance Method Details

#accepts?(uri) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/jschematic/attributes/format.rb', line 21

def accepts?(uri)
  Addressable::URI.parse(uri)
rescue Addressable::URI::InvalidURIError
  false
end