Class: EmailInquire::Response
- Inherits:
-
Object
- Object
- EmailInquire::Response
- Defined in:
- lib/email_inquire/response.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#replacement ⇒ Object
Returns the value of attribute replacement.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #hint!(domain:) ⇒ Object
- #hint? ⇒ Boolean
-
#initialize(email:) ⇒ Response
constructor
A new instance of Response.
- #invalid! ⇒ Object
- #invalid? ⇒ Boolean
- #status? ⇒ Boolean
- #valid! ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(email:) ⇒ Response
Returns a new instance of Response.
9 10 11 |
# File 'lib/email_inquire/response.rb', line 9 def initialize(email:) @email = email end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/email_inquire/response.rb', line 6 def email @email end |
#replacement ⇒ Object
Returns the value of attribute replacement.
7 8 9 |
# File 'lib/email_inquire/response.rb', line 7 def replacement @replacement end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/email_inquire/response.rb', line 7 def status @status end |
Instance Method Details
#hint!(domain:) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/email_inquire/response.rb', line 13 def hint!(domain:) self.status = :hint old_name, _old_domain = email.split("@") self.replacement = "#{old_name}@#{domain}" self end |
#hint? ⇒ Boolean
22 23 24 |
# File 'lib/email_inquire/response.rb', line 22 def hint? status.equal?(:hint) end |
#invalid! ⇒ Object
26 27 28 29 30 |
# File 'lib/email_inquire/response.rb', line 26 def invalid! self.status = :invalid self end |
#invalid? ⇒ Boolean
32 33 34 |
# File 'lib/email_inquire/response.rb', line 32 def invalid? status.equal?(:invalid) end |
#status? ⇒ Boolean
36 37 38 |
# File 'lib/email_inquire/response.rb', line 36 def status? !status.nil? end |
#valid! ⇒ Object
40 41 42 43 44 |
# File 'lib/email_inquire/response.rb', line 40 def valid! self.status = :valid self end |
#valid? ⇒ Boolean
46 47 48 |
# File 'lib/email_inquire/response.rb', line 46 def valid? status.equal?(:valid) end |