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


8
9
10
# File 'lib/accession/accession/contact.rb', line 8

def initialize(user)
  @user = user
end

Instance Attribute Details

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

#emailObject


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

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

#nameObject


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

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

#to_hObject


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