Class: Opto::Types::Uri

Inherits:
Opto::Type show all
Defined in:
lib/opto/types/uri.rb

Overview

An uri/url.

Options:

schemes: an array of allowed schemes, such as ['http', 'https', 'file']

Constant Summary

Constants inherited from Opto::Type

Opto::Type::GLOBAL_OPTIONS

Instance Attribute Summary

Attributes inherited from Opto::Type

#options

Instance Method Summary collapse

Methods inherited from Opto::Type

#errors, for, inherited, #initialize, #required?, #sanitize, sanitizer, sanitizers, true_when, type, #type, types, #valid?, #validate, validator, validators

Constructor Details

This class inherits a constructor from Opto::Type

Instance Method Details

#uri(value) ⇒ Object


30
31
32
# File 'lib/opto/types/uri.rb', line 30

def uri(value)
  URI.parse(value)
end