Module: EasyTalk::Model

Defined in:
lib/easy_talk/model.rb

Overview

The Model module is a mixin that provides functionality for defining and accessing the schema of a model.

It includes methods for defining the schema, retrieving the schema definition, and generating the JSON schema for the model.

Example usage:

class Person include EasyTalk::Model

define_schema do
  property :name, String, description: 'The person\'s name'
  property :age, Integer, description: 'The person\'s age'
end

end

Person.json_schema #=> returns the JSON schema for Person jim = Person.new(name: 'Jim', age: 30) jim.valid? #=> returns true

See Also:

Defined Under Namespace

Modules: ClassMethods, InstanceMethods