Method: Brief::Model::ClassMethods#to_schema

Defined in:
lib/brief/model.rb

#to_schemaObject



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/brief/model.rb', line 115

def to_schema
  {
    schema: {
      content: definition.content_schema,
      metadata: definition.,
    },
    class_name: to_s,
    type_alias: type_alias,
    name: name,
    group: name.to_s.pluralize,
    actions: defined_actions,
    example: definition.example_body.to_s,
    template: definition.template_body.to_s,
    urls: {
      browse_url: "browse/#{ type_alias.to_s.pluralize }",
      schema_url: "schema/#{ type_alias }"
    }
  }
end