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.



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

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.



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

def current_ability
  @current_ability
end

#solr_documentObject (readonly)

Returns the value of attribute solr_document.



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

def solr_document
  @solr_document
end

Instance Method Details

#solrObject



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

def solr
  @solr_document.inspect
end

#workflowObject



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

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