Module: Plumb::Types::Forms::URI

Defined in:
lib/plumb/types.rb

Overview

Turn strings into different URI types

Constant Summary collapse

Generic =

URI.parse is very permisive - a blank string is valid. We want to ensure that a generic URI at least starts with a scheme as per RFC 3986

Types::URI::Generic | (String[/^([a-z][a-z0-9+\-.]*)/].build(::URI, :parse))
HTTP =
Generic[::URI::HTTP]
File =
Generic[::URI::File]