Methods
D
Instance Public methods
describe()
   # File rhino/rhino/lib/rhino/resource/active_model_extension/describe.rb
10 def describe # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
11   properties = all_properties.index_with { |p| describe_property(p) }
12 
13   required = properties.reject { |_p, d| d[:nullable] || d[:readOnly] }.keys
14   # required: [] is not valid and will be compacted away
15   required = nil unless required.present?
16 
17   {
18     "x-rhino-model": {
19       model: model_name.singular,
20       modelPlural: model_name.collection,
21       name: model_name.name.camelize(:lower),
22       pluralName: model_name.name.camelize(:lower).pluralize,
23       readableName: model_name.human,
24       pluralReadableName: model_name.human.pluralize,
25       ownedBy: resource_owned_by,
26       path: "#{Rhino.namespace}/#{route_path}"
27     },
28     type: :object,
29     properties: properties,
30     required: required
31   }.compact
32 end