Method: Hyrax::PresenterFactory.build_for

Defined in:
app/presenters/hyrax/presenter_factory.rb

.build_for(ids:, presenter_class:, presenter_args: []) ⇒ Array

TODO:

Convert to find and yield only the found SOLR documents. There is a coupling of knowledge regarding the building of the presenter class and its parameters.

TODO:

We are looping through SOLR docs three times; Can this be compressed into a single loop

Returns presenters for the documents in order of the ids (as given).

Parameters:

  • ids (Array)

    the list of ids to load

  • presenter_class (Class)

    the class of presenter to make

  • presenter_args (Array) (defaults to: [])

    any other arguments to pass to the presenters

Returns:

  • (Array)

    presenters for the documents in order of the ids (as given)



15
16
17
# File 'app/presenters/hyrax/presenter_factory.rb', line 15

def build_for(ids:, presenter_class:, presenter_args: [])
  new(ids: ids, presenter_class: presenter_class, presenter_args: presenter_args).build
end