Class: JSONSkooma::Validators::IriReference

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

Constant Summary collapse

REGEX =
/\A#{Iri::IRI_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/iri_reference.rb', line 8

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

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