Methods
- D
- S
Instance Public methods
describe()
Link
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_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: route_api, 27 searchable: searchable? 28 }, 29 type: :object, 30 properties: properties, 31 required: required 32 }.compact 33 end