Class: Sipity::Decorators::Recommendations::DoiRecommendation

Inherits:
Base
  • Object
show all
Defined in:
app/decorators/sipity/decorators/recommendations/doi_recommendation.rb

Overview

Container for the DOI Recommendation

Instance Attribute Summary

Attributes inherited from Base

#helper, #repository, #sip

Instance Method Summary collapse

Methods inherited from Base

#default_helper, #default_repository, #human_attribute_name, #human_name, #human_status, #initialize, #translation_scope

Constructor Details

This class inherits a constructor from Sipity::Decorators::Recommendations::Base

Instance Method Details

#doi_already_assigned?Boolean (private)

Returns:

  • (Boolean)


23
24
25
# File 'app/decorators/sipity/decorators/recommendations/doi_recommendation.rb', line 23

def doi_already_assigned?
  repository.doi_already_assigned?(sip)
end

#doi_request_is_pending?Boolean (private)

Returns:

  • (Boolean)


19
20
21
# File 'app/decorators/sipity/decorators/recommendations/doi_recommendation.rb', line 19

def doi_request_is_pending?
  repository.doi_request_is_pending?(sip)
end

#path_to_recommendationObject



13
14
15
# File 'app/decorators/sipity/decorators/recommendations/doi_recommendation.rb', line 13

def path_to_recommendation
  helper.sip_doi_path(sip)
end

#stateObject Also known as: status



6
7
8
9
10
# File 'app/decorators/sipity/decorators/recommendations/doi_recommendation.rb', line 6

def state
  return :doi_already_assigned if doi_already_assigned?
  return :doi_request_is_pending if doi_request_is_pending?
  return :doi_not_assigned
end