def schema(_name, opts = {})
      define_method(:definition) { opts }

      opts.each do |k, definition|
        # Reader
        attr_reader k

        # Writer
        define_writer! k, definition
      end
    end
def schema(_name, opts = {})
      define_method(:definition) { opts }

      opts.each do |k, definition|
        # Reader
        attr_reader k

        # Writer
        define_writer! k, definition
      end
    end
Dynamically configures accessors, dirty tracking, validation,
 and serialization methods given definition in opts
 @param [Object] _name - name of schema
 @param [Hash] opts - See below

  class AwesomeClass
    schema :my_schema,
      id: {
       type: Numeric,             # value will be checked using is_a?
       valid: -> (v) { v > 0 },   # value will be validated by calling this
       schema: [ChildClass]       # single or collection recursive checks
       doc: 'Id, number greater than 1'  # documentation string
      }
  end

  a = AwesomeClass.new(id: 1)
  a.valid? => true
  a.errors => {}