Class: Domain::Email
- Inherits:
-
Object
- Object
- Domain::Email
- 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
-
#date ⇒ Object
Returns the value of attribute date.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(subject, sender, date) ⇒ Email
constructor
Initializes a Domain::Email instance with the specified subject, sender, and date.
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
#date ⇒ Object
Returns the value of attribute date.
10 11 12 |
# File 'lib/bas/domain/email.rb', line 10 def date @date end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
9 10 11 |
# File 'lib/bas/domain/email.rb', line 9 def sender @sender end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
9 10 11 |
# File 'lib/bas/domain/email.rb', line 9 def subject @subject end |