Class: Sufia::Workflow::WorkflowByAdminSetStrategy

Inherits:
Object
  • Object
show all
Defined in:
app/services/sufia/workflow/workflow_by_admin_set_strategy.rb

Instance Method Summary collapse

Constructor Details

#initialize(_work, attributes) ⇒ WorkflowByAdminSetStrategy

Returns a new instance of WorkflowByAdminSetStrategy.



4
5
6
# File 'app/services/sufia/workflow/workflow_by_admin_set_strategy.rb', line 4

def initialize(_work, attributes)
  @admin_set_id = attributes[:admin_set_id] if attributes[:admin_set_id].present?
end

Instance Method Details

#workflow_nameString

Returns The name of the workflow by admin_set to use.

Returns:

  • (String)

    The name of the workflow by admin_set to use



9
10
11
12
# File 'app/services/sufia/workflow/workflow_by_admin_set_strategy.rb', line 9

def workflow_name
  return 'default' unless @admin_set_id
  Sufia::PermissionTemplate.find_by!(admin_set_id: @admin_set_id).workflow_name
end