Class: Accession::Contact

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#userObject (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

#emailObject



17
18
19
# File 'lib/accession/accession/contact.rb', line 17

def email
  @email ||= "#{user.}@#{configatron.default_email_domain}"
end

#nameObject



13
14
15
# File 'lib/accession/accession/contact.rb', line 13

def name
  @name ||= "#{user.first_name} #{user.last_name}"
end

#to_hObject



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