From 8ea514f166a65be494bbfac18d3977fd493ac661 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Tue, 29 Mar 2022 16:06:19 -0700 Subject: [PATCH] fixup `Hyrax::Schema()` documentation formatting, edit for clarity i had occasion to read this documentation and thought it could use some tidying. the formatting edits make the YARD render correctly in browser. --- lib/hyrax/schema.rb | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/hyrax/schema.rb b/lib/hyrax/schema.rb index e22abe369f..0a96b2c5ad 100644 --- a/lib/hyrax/schema.rb +++ b/lib/hyrax/schema.rb @@ -4,24 +4,27 @@ module Hyrax ## # @api public # - # Builds a schema module for a Valkyrie resource. The schema itself is - # resolved by schema loader, which must respond to - # `#attributes_for(schema: :name)` with a hash from attribute names to - # `Dry::Type` types. + # Builds a schema module for a +Valkyrie::Resource+. The schema itself is + # resolved by a schema loader instance, which must implement + # {SimpleSchemaLoader#attributes_for}, with a hash from attribute names to + # +Dry::Type+ types. # # For the default schema loader, configuration is loaded from - # `config/metadata/[name]}.yaml`. Custom schema loaders can be provided - # for other types. + # +config/metadata/{name}.yaml+. A custom schema loader can be provided as + # +:schema_loader+ to + # resolve the schema in other ways. # - # @note `Valkyrie::Resources`/`Hyrax::Resources` are not required to use this - # interface, and may define custom attributes using the base - # `Valkyrie::Resource.attribute` interface. This mechanism is provided to - # allow schemas to be defined in a unified way that don't require programmer - # intervention ("configurable schemas"). While the default usage defines - # schemas in application configuration, they could also be held in repository - # storage, an external schema service, etc... by using a custom schema loader. + # @note +Valkyrie::Resource+ and {Hyrax::Resource} classes are not required to + # use this interface, and may define custom attributes using the base + # +Valkyrie::Resource.attribute+ interface. This mechanism is provided to + # allow schemas to be defined in a unified way that don't require programmer + # intervention ("configurable schemas"). While the default schema loader derives + # schemas from configuration files, alternate implementations could provide + # schema definitions pulled from repository storage, an external schema service, + # etc... # # @param [Symbol] schema_name + # @param [#attributes_for] schema_loader # # @return [Module] a module that, when included, applies a schema to a # `Valkyire::Resource`