Class: JSONSkooma::Validators::UriReference

Inherits:
Base
  • Object
show all
Defined in:
lib/json_skooma/validators/uri_reference.rb

Constant Summary collapse

REGEX =
/\A#{Uri::URI_REFERENCE}\z/.freeze

Instance Method Summary collapse

Methods inherited from Base

assert?, call, inherited

Instance Method Details

#call(data) ⇒ Object

Raises:



8
9
10
11
12
# File 'lib/json_skooma/validators/uri_reference.rb', line 8

def call(data)
  return if REGEX.match?(data.value)

  raise FormatError, "#{data} is not a valid URI reference"
end