Class: Hyrax::Transactions::Steps::EnsureAdminSet

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

Overview

A step that ensures the input object has an `#admin_set_id`.

Since:

  • 2.4.0

Instance Method Summary collapse

Instance Method Details

#call(obj) ⇒ Dry::Monads::Result

Returns `Failure` if there is no `AdminSet` for the input; `Success(input)`, otherwise.

Parameters:

  • obj (#admin_set_id)

Returns:

  • (Dry::Monads::Result)

    `Failure` if there is no `AdminSet` for the input; `Success(input)`, otherwise.

Since:

  • 2.4.0


17
18
19
# File 'lib/hyrax/transactions/steps/ensure_admin_set.rb', line 17

def call(obj)
  obj.admin_set_id ? Success(obj) : Failure(:no_admin_set_id)
end