Class: Gadgeto::Email

Inherits:
Object
  • Object
show all
Includes:
Validators
Defined in:
lib/gadgeto/email.rb,
lib/gadgeto/email/validators.rb

Defined Under Namespace

Modules: Validators

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Validators

#email?

Constructor Details

#initialize(email) ⇒ Email

Returns a new instance of Email.



14
15
16
# File 'lib/gadgeto/email.rb', line 14

def initialize(email)
  @email = email
end

Class Method Details

.valid?(object) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/gadgeto/email.rb', line 8

def valid?(object)
  o = new object
  o.valid?
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/gadgeto/email.rb', line 18

def valid?
  email? @email
end