Module: Jimmy::Macros
Overview
The Macros
module includes methods that can be called directly on the Jimmy
module for quickly making common types of schemas.
Constant Summary
Constants included from Declaration
Declaration::BOOLEANS, Declaration::FORMATS, Declaration::SIMPLE_TYPES
Instance Method Summary collapse
-
#nothing ⇒ Schema
Make a schema that never validates.
-
#ref(uri) ⇒ Schema
Make a schema that references another schema by URI.
-
#schema {|schema| ... } ⇒ Schema
Make a new schema.
Methods included from Declaration
#all_of, #any_of, #array, #boolean, #const, #date, #date_time, #default, #define, #definitions, #description, #email, #enum, #examples, #hostname, #idn_email, #idn_hostname, #if, #integer, #ipv4, #ipv6, #iri, #iri_reference, #json_pointer, #multiple_of, #not, #null, #number, #object, #one_of, #pattern, #range, #read_only, #regex, #relative_json_pointer, #string, #struct, #time, #title, #type, #uri, #uri_reference, #uri_template, #write_only
Instance Method Details
#nothing ⇒ Schema
Make a schema that never validates.
20 21 22 |
# File 'lib/jimmy/macros.rb', line 20 def nothing schema.nothing end |
#ref(uri) ⇒ Schema
Make a schema that references another schema by URI.
27 28 29 |
# File 'lib/jimmy/macros.rb', line 27 def ref(uri) schema.ref uri end |