Maru. Params. Schema
(maru_params v0.2.15)
Copy Markdown
A module holding named params blocks which other modules reuse with include.
defmodule MyApp.Params.Address do
use Maru.Params.Schema
params :basic do
requires :city, String
requires :zipcode, String
end
params :full do
requires :address_line_1, String
requires :city, String
requires :zipcode, String
end
endparams do ... end defines the anonymous block, named :default.
Options
:reads- field names thegivenconditions of this schema read from the level it is included into, defaults to[]:structand:derive- define a struct from the declared params, same options asMaru.Params.TypeBuilder
Generated functions
__maru_params__() # block names in declaration order
__maru_params__(:basic) # params runtime of one block
__maru_reads__() # the `reads:` option
__maru_given__(:basic) # literal key/value pairs of the block's givens
__maru_includes__(:basic) # includes recorded in the block, checked by
# Maru.Params.verify_all/1
Summary
Functions
Resolve the params runtime an include refers to, called at runtime by the
code include generated.