Module: EasyTalk::Model::ClassMethods
- Includes:
- SchemaBase::ClassMethods
- Defined in:
- lib/easy_talk/model.rb
Overview
Module containing class-level methods for defining and accessing the schema of a model.
Instance Method Summary collapse
- #additional_properties_allowed? ⇒ Boolean included from SchemaBase::ClassMethods
-
#define_schema(options = {}) { ... } ⇒ Object
Define the schema for the model using the provided block.
-
#json_schema ⇒ Hash
included
from SchemaMethods
Returns the JSON schema for the model.
- #properties ⇒ Object included from SchemaBase::ClassMethods
-
#ref_template ⇒ String
included
from SchemaMethods
Returns the reference template for the model.
- #schema ⇒ Object included from SchemaBase::ClassMethods
- #schema_definition ⇒ Object included from SchemaBase::ClassMethods
Instance Method Details
#additional_properties_allowed? ⇒ Boolean Originally defined in module SchemaBase::ClassMethods
#define_schema(options = {}) { ... } ⇒ Object
Define the schema for the model using the provided block.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/easy_talk/model.rb', line 102 def define_schema( = {}, &) super(&) # Store validation options for this model @validation_options = () # Initialize mutex eagerly for thread-safe schema-level validation application @schema_level_validation_lock = Mutex.new # Apply validations using the adapter system apply_schema_validations @schema_definition end |
#json_schema ⇒ Hash Originally defined in module SchemaMethods
Returns the JSON schema for the model. This is the final output that includes the $schema keyword if configured.
#properties ⇒ Object Originally defined in module SchemaBase::ClassMethods
#ref_template ⇒ String Originally defined in module SchemaMethods
Returns the reference template for the model. When prefer_external_refs is enabled and the model has a schema ID, returns the external $id URI. Otherwise, returns the local $defs reference.