Class: Sipity::Forms::RequestADoiForm

Inherits:
BaseForm
  • Object
show all
Defined in:
app/forms/sipity/forms/request_a_doi_form.rb

Overview

Submit a request for a DOI for the given Sip

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseForm

#persisted?, #submit, #to_key, #to_param

Constructor Details

#initialize(attributes = {}) ⇒ RequestADoiForm



7
8
9
10
# File 'app/forms/sipity/forms/request_a_doi_form.rb', line 7

def initialize(attributes = {})
  self.sip = attributes.fetch(:sip)
  @publisher, @publication_date = attributes.values_at(:publisher, :publication_date)
end

Instance Attribute Details

#publication_dateObject

Returns the value of attribute publication_date



12
13
14
# File 'app/forms/sipity/forms/request_a_doi_form.rb', line 12

def publication_date
  @publication_date
end

#publisherObject

Returns the value of attribute publisher



12
13
14
# File 'app/forms/sipity/forms/request_a_doi_form.rb', line 12

def publisher
  @publisher
end

#sipObject

Returns the value of attribute sip



12
13
14
# File 'app/forms/sipity/forms/request_a_doi_form.rb', line 12

def sip
  @sip
end

Instance Method Details

#authors(decorator: Decorators::CollaboratorDecorator) ⇒ Object



21
22
23
24
# File 'app/forms/sipity/forms/request_a_doi_form.rb', line 21

def authors(decorator: Decorators::CollaboratorDecorator)
  Queries::CollaboratorQueries.sip_collaborators_for(sip: sip, role: 'author').
    map { |obj| decorator.decorate(obj) }
end