Class: Hyrax::SimpleSchemaLoader Private

Inherits:
SchemaLoader show all
Defined in:
app/services/hyrax/simple_schema_loader.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This is a simple yaml config-driven schema loader

See Also:

  • for an example configuration

Instance Method Summary collapse

Methods inherited from SchemaLoader

#attributes_for, #current_version, #form_definitions_for, #index_rules_for

Instance Method Details

#permissive_schema_for_valkrie_adapterObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:enable Lint/UnusedMethodArgument



18
19
20
21
22
# File 'app/services/hyrax/simple_schema_loader.rb', line 18

def permissive_schema_for_valkrie_adapter
  .each_with_object({}) do |schema_name, ret_hsh|
    predicate_pairs(ret_hsh, schema_name)
  end
end

#view_definitions_for(schema:, version: 1, contexts: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:disable Lint/UnusedMethodArgument



11
12
13
14
15
16
# File 'app/services/hyrax/simple_schema_loader.rb', line 11

def view_definitions_for(schema:, version: 1, contexts: nil) # rubocop:disable Lint/UnusedMethodArgument
  schema.each_with_object({}) do |property, |
    view_options = property.meta['view']
    [property.name.to_s] = view_options.with_indifferent_access unless view_options.nil?
  end
end