Class: Hyrax::InspectWorkPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/inspect_work_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(solr_document, current_ability) ⇒ InspectWorkPresenter

Returns a new instance of InspectWorkPresenter.


3
4
5
6
# File 'app/presenters/hyrax/inspect_work_presenter.rb', line 3

def initialize(solr_document, current_ability)
  @solr_document = solr_document
  @current_ability = current_ability
end

Instance Attribute Details

#current_abilityObject (readonly)

Returns the value of attribute current_ability


7
8
9
# File 'app/presenters/hyrax/inspect_work_presenter.rb', line 7

def current_ability
  @current_ability
end

#solr_documentObject (readonly)

Returns the value of attribute solr_document


7
8
9
# File 'app/presenters/hyrax/inspect_work_presenter.rb', line 7

def solr_document
  @solr_document
end

Instance Method Details

#solrObject


23
24
25
# File 'app/presenters/hyrax/inspect_work_presenter.rb', line 23

def solr
  @solr_document.inspect
end

#workflowObject


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/presenters/hyrax/inspect_work_presenter.rb', line 9

def workflow
  return { comments: [], roles: [] } unless sipity_entity
  {
    entity_id: sipity_entity.id,
    proxy_for: sipity_entity.proxy_for_global_id,
    workflow_id: sipity_entity.workflow_id,
    workflow_name: sipity_entity.workflow_name,
    state_id: sipity_entity.workflow_state_id,
    state_name: sipity_entity.workflow_state_name,
    comments: workflow_comments,
    roles: sipity_entity_roles
  }
end