Class: Worthwhile::ContributorAgreement

Inherits:
Object
  • Object
show all
Defined in:
app/models/worthwhile/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.



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

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.



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

def curation_concern
  @curation_concern
end

#param_valueObject (readonly)

Returns the value of attribute param_value.



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

def param_value
  @param_value
end

#userObject (readonly)

Returns the value of attribute user.



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

def user
  @user
end

Instance Method Details

#acceptance_valueObject



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

def acceptance_value
  'accept'
end

#is_being_accepted?Boolean

Returns:

  • (Boolean)


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

def is_being_accepted?
  param_value == acceptance_value
end

#param_keyObject



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

def param_key
  :accept_contributor_agreement
end