Class: OpencJsonSchemaFormats::URIValidator
- Inherits:
-
Object
- Object
- OpencJsonSchemaFormats::URIValidator
- Defined in:
- lib/openc_json_schema_formats.rb
Instance Method Summary collapse
-
#validate(record) ⇒ Object
Actually, this only checks http and https formats, so isn’t really for URIs.
Instance Method Details
#validate(record) ⇒ Object
Actually, this only checks http and https formats, so isn’t really for URIs
24 25 26 27 28 29 30 31 |
# File 'lib/openc_json_schema_formats.rb', line 24 def validate(record) begin uri = URI.parse(record) uri.kind_of?(URI::HTTP) || uri.kind_of?(URI::HTTPS) rescue URI::InvalidURIError false end end |