Class: Hyrax::Transactions::Steps::EnsureAdminSet
- Inherits:
-
Object
- Object
- Hyrax::Transactions::Steps::EnsureAdminSet
- Defined in:
- lib/hyrax/transactions/steps/ensure_admin_set.rb
Overview
A step that ensures the input object has an #admin_set_id.
Instance Method Summary collapse
-
#call(obj) ⇒ Dry::Monads::Result
Failureif there is noAdminSetfor the input;Success(input), otherwise.
Instance Method Details
#call(obj) ⇒ Dry::Monads::Result
Returns Failure if there is no AdminSet for
the input; Success(input), otherwise.
17 18 19 |
# File 'lib/hyrax/transactions/steps/ensure_admin_set.rb', line 17 def call(obj) obj.admin_set_id.to_s.present? ? Success(obj) : Failure(:no_admin_set_id) end |