Class: EmailVeracity::Address
- Inherits:
-
Object
- Object
- EmailVeracity::Address
- Includes:
- Validatability
- Defined in:
- lib/email_veracity/address.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
Instance Method Summary collapse
- #email_address ⇒ Object
- #email_address=(new_email_address) ⇒ Object
-
#initialize(email = '') ⇒ Address
constructor
A new instance of Address.
- #to_s ⇒ Object
Methods included from Validatability
Constructor Details
#initialize(email = '') ⇒ Address
Returns a new instance of Address.
8 9 10 |
# File 'lib/email_veracity/address.rb', line 8 def initialize(email = '') self.email_address = email end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
6 7 8 |
# File 'lib/email_veracity/address.rb', line 6 def domain @domain end |
Instance Method Details
#email_address ⇒ Object
16 17 18 |
# File 'lib/email_veracity/address.rb', line 16 def email_address @email_address.to_s.strip end |
#email_address=(new_email_address) ⇒ Object
20 21 22 23 |
# File 'lib/email_veracity/address.rb', line 20 def email_address=(new_email_address) @email_address = new_email_address.to_s @domain = Domain.new(@email_address.split('@')[1] || '') end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/email_veracity/address.rb', line 12 def to_s email_address end |