Skip to content

Instantly share code, notes, and snippets.

@toshia
Created November 23, 2018 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toshia/4c03b80a30f2594e480d9cd22fdea027 to your computer and use it in GitHub Desktop.
Save toshia/4c03b80a30f2594e480d9cd22fdea027 to your computer and use it in GitHub Desktop.
Diva Schemaを渡してDiva::Modelを定義するやつ
Diva::Model(
fields: [
{ name: "fields",
constraint: { array: { type: "diva://object.type/field" } }
},
{ name: "required",
constraint: { type: "diva://atomic.type/boolean" }
},
{ name: "uri",
constraint: { type: "diva://atomic.type/uri" }
}
],
required: %w[fields uri],
uri: "diva://object.type/model"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment