Class: Iz::Email
- Inherits:
-
Object
- Object
- Iz::Email
- Defined in:
- lib/iz/email.rb
Constant Summary collapse
- REGEX =
/.+@.+/
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(email) ⇒ Email
constructor
A new instance of Email.
- #valid? ⇒ Boolean
Constructor Details
#initialize(email) ⇒ Email
Returns a new instance of Email.
7 8 9 |
# File 'lib/iz/email.rb', line 7 def initialize(email) self.value = email end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/iz/email.rb', line 5 def value @value end |
Class Method Details
.is_email?(value) ⇒ Boolean
15 16 17 |
# File 'lib/iz/email.rb', line 15 def self.is_email?(value) value.to_s =~ REGEX end |
Instance Method Details
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/iz/email.rb', line 11 def valid? !!Iz::Email.is_email?(value) end |