Class: Domain::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/domain/email.rb

Overview

The Domain::Email class provides a domain-specific representation of an Email object. It encapsulates information about an email, including the subject, the sender, and the date.

Constant Summary collapse

ATTRIBUTES =
%w[subject sender date].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject, sender, date) ⇒ Email

Initializes a Domain::Email instance with the specified subject, sender, and date.


Params:

  • String email subject.

  • String Email of the sender.

  • String Reception date



22
23
24
25
26
# File 'lib/bas/domain/email.rb', line 22

def initialize(subject, sender, date)
  @subject = subject
  @sender = sender
  @date = parse_to_datetime(date)
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



10
11
12
# File 'lib/bas/domain/email.rb', line 10

def date
  @date
end

#senderObject (readonly)

Returns the value of attribute sender.



9
10
11
# File 'lib/bas/domain/email.rb', line 9

def sender
  @sender
end

#subjectObject (readonly)

Returns the value of attribute subject.



9
10
11
# File 'lib/bas/domain/email.rb', line 9

def subject
  @subject
end