Class: Esplanade::Response::Validation
- Inherits:
-
Object
- Object
- Esplanade::Response::Validation
- Defined in:
- lib/esplanade/response/validation.rb
Instance Method Summary collapse
-
#initialize(request, doc, raw) ⇒ Validation
constructor
A new instance of Validation.
- #valid! ⇒ Object
Constructor Details
#initialize(request, doc, raw) ⇒ Validation
6 7 8 9 10 |
# File 'lib/esplanade/response/validation.rb', line 6 def initialize(request, doc, raw) @request = request @doc = doc @raw = raw end |
Instance Method Details
#valid! ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/esplanade/response/validation.rb', line 12 def valid! @error ||= if @doc.json_schemas.size == 1 one_json_schema else more_than_one_json_schema end raise Invalid.new(**) if @error != [] end |