Schematics::Model
Inherits Reference / Object
Model base class
Simpler implementation using explicit field registration Example:
class User < Schematics::Model
field email, String, required: true, validators: [min_length(5)]
field age, Int32, default: 0, validators: [gte(0)]
end
Instance methods
errors
Sourceto_json
SourceMacros
field(name, type, required = false, default = nil, validators = nil, coerce = false)
Field definition macro - simpler approach coerce: true enables automatic type coercion from compatible types