Class: JSONSkooma::Validators::JSONPointer
- Defined in:
- lib/json_skooma/validators/json_pointer.rb
Constant Summary collapse
- ESC =
/~[01]/
- UNESC =
/[\u0000-\u002E\u0030-\u007d\u007F-\u{10FFFF}]/
- TOKEN =
/(#{ESC}|#{UNESC})*/
- JSON_POINTER =
/(\/#{TOKEN})*/
- REGEXP =
/\A#{JSON_POINTER}\z/
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#call(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/json_skooma/validators/json_pointer.rb', line 12 def call(data) return if REGEXP.match?(data) raise FormatError, "#{data} is not a valid JSON pointer" end |