Class: ContributorAgreement

Inherits:
Object
  • Object
show all
Defined in:
app/models/contributor_agreement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(curation_concern, user, params) ⇒ ContributorAgreement

Returns a new instance of ContributorAgreement.



3
4
5
6
7
# File 'app/models/contributor_agreement.rb', line 3

def initialize(curation_concern, user, params)
  @curation_concern = curation_concern
  @user = user
  @param_value = params[param_key.to_sym] || params[param_key.to_s]
end

Instance Attribute Details

#curation_concernObject (readonly)

Returns the value of attribute curation_concern.



2
3
4
# File 'app/models/contributor_agreement.rb', line 2

def curation_concern
  @curation_concern
end

#param_valueObject (readonly)

Returns the value of attribute param_value.



16
17
18
# File 'app/models/contributor_agreement.rb', line 16

def param_value
  @param_value
end

#userObject (readonly)

Returns the value of attribute user.



2
3
4
# File 'app/models/contributor_agreement.rb', line 2

def user
  @user
end

Instance Method Details

#acceptance_valueObject



9
10
11
# File 'app/models/contributor_agreement.rb', line 9

def acceptance_value
  'accept'
end

#is_being_accepted?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/contributor_agreement.rb', line 18

def is_being_accepted?
  param_value == acceptance_value
end

#param_keyObject



13
14
15
# File 'app/models/contributor_agreement.rb', line 13

def param_key
  :accept_contributor_agreement
end