type, opts \\ []) do quote location: :keep do Ectoo.Table.__attribute__(__MODULE__, unquote(name), unquote(type), unquote(opts)) end end def __attribute__(module, name, type, opts) do # ... validate opts attribute = %Ectoo.Attribute{ name: name, type: type, default: opts[:default], description: opts[:description], required?: opts[:required?] || false } Module.put_attribute(module, :ectoo_attributes, attribute) end # ... end