Class: Hyrax::Workflow::ObjectInWorkflowDecorator

Inherits:
ModelDecorator
  • Object
show all
Defined in:
app/services/hyrax/workflow/object_in_workflow_decorator.rb

Overview

Decorates objects with attributes with their workflow state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ModelDecorator

#to_model

Instance Attribute Details

#workflow=(value) ⇒ Sipity::Workflow (writeonly)

Returns:



15
16
17
# File 'app/services/hyrax/workflow/object_in_workflow_decorator.rb', line 15

def workflow=(value)
  @workflow = value
end

#workflow_stateString

Returns:

  • (String)


26
27
28
# File 'app/services/hyrax/workflow/object_in_workflow_decorator.rb', line 26

def workflow_state
  @workflow_state&.name || 'unknown'
end

Instance Method Details

#published?Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'app/services/hyrax/workflow/object_in_workflow_decorator.rb', line 19

def published?
  Hyrax::Admin::WorkflowsController.deposited_workflow_state_name ==
    workflow_state
end