Class: Hyrax::Transactions::Steps::SaveCollectionLogo

Inherits:
Object
  • Object
show all
Defined in:
lib/hyrax/transactions/steps/save_collection_logo.rb

Overview

Adds logo info via ‘ChangeSet`.

During the update collection process this step is called to update the file(s) to be used as logo(s) for the collection.

Since:

  • 2.4.0

Instance Method Summary collapse

Instance Method Details

#call(collection_resource, update_logo_file_ids: nil, alttext_values: nil, linkurl_values: nil) ⇒ Dry::Monads::Result

Returns ‘Failure` if the work fails to save; `Success(input)`, otherwise.

Parameters:

  • change_set (Hyrax::ChangeSet)
  • update_logo_file_ids (Array<#Integer>) (defaults to: nil)
  • alttext_values (Array<String>) (defaults to: nil)
  • linkurl_values (Array<String>) (defaults to: nil)

Returns:

  • (Dry::Monads::Result)

    ‘Failure` if the work fails to save; `Success(input)`, otherwise.

Since:

  • 2.4.0



22
23
24
25
26
# File 'lib/hyrax/transactions/steps/save_collection_logo.rb', line 22

def call(collection_resource, update_logo_file_ids: nil, alttext_values: nil, linkurl_values: nil)
  collection_id = collection_resource.id.to_s
  process_logo_input(collection_id: collection_id, update_logo_file_ids: update_logo_file_ids, alttext_values: alttext_values, linkurl_values: linkurl_values)
  Success(collection_resource)
end