Class: Accession::Contact
- Inherits:
-
Object
- Object
- Accession::Contact
- Defined in:
- lib/accession/accession/contact.rb
Overview
The contact will be the person who will be informed if accessioning errors or if the status needs to be checked. Is this ever used?
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #email ⇒ Object
-
#initialize(user) ⇒ Contact
constructor
A new instance of Contact.
- #name ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(user) ⇒ Contact
Returns a new instance of Contact.
9 10 11 |
# File 'lib/accession/accession/contact.rb', line 9 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'lib/accession/accession/contact.rb', line 7 def user @user end |
Instance Method Details
#email ⇒ Object
17 18 19 |
# File 'lib/accession/accession/contact.rb', line 17 def email @email ||= "#{user.login}@#{configatron.default_email_domain}" end |
#name ⇒ Object
13 14 15 |
# File 'lib/accession/accession/contact.rb', line 13 def name @name ||= "#{user.first_name} #{user.last_name}" end |
#to_h ⇒ Object
21 22 23 |
# File 'lib/accession/accession/contact.rb', line 21 def to_h { inform_on_error: email, inform_on_status: email, name: name } end |