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.
8 9 10 |
# File 'lib/accession/accession/contact.rb', line 8 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user
6 7 8 |
# File 'lib/accession/accession/contact.rb', line 6 def user @user end |
Instance Method Details
#email ⇒ Object
16 17 18 |
# File 'lib/accession/accession/contact.rb', line 16 def email @email ||= "#{user.login}@#{configatron.default_email_domain}" end |
#name ⇒ Object
12 13 14 |
# File 'lib/accession/accession/contact.rb', line 12 def name @name ||= "#{user.first_name} #{user.last_name}" end |
#to_h ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/accession/accession/contact.rb', line 20 def to_h { inform_on_error: email, inform_on_status: email, name: name } end |