Class: HermesTan
- Inherits:
-
Object
- Object
- HermesTan
- Defined in:
- lib/hermes_tan.rb
Overview
The main Hermes driver
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
#initialize Arguments: email: (String) password: (String).
-
#password ⇒ Object
readonly
#initialize Arguments: email: (String) password: (String).
Instance Method Summary collapse
-
#initialize(email, password) ⇒ HermesTan
constructor
A new instance of HermesTan.
- #let_gods_know_about(gods, subject, body) ⇒ Object
Constructor Details
#initialize(email, password) ⇒ HermesTan
Returns a new instance of HermesTan.
35 36 37 38 39 40 41 |
# File 'lib/hermes_tan.rb', line 35 def initialize(email, password) raise NoCredentialsProvidedError unless password && email raise InvalidEmailError unless email =~ /\b[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}\z/ @email = email @password = password end |
Instance Attribute Details
#email ⇒ Object (readonly)
#initialize Arguments:
email: (String)
password: (String)
#let_gods_know_about Arguments:
gods: Array of emails (Strings)
subject: (String)
body: (String)
33 34 35 |
# File 'lib/hermes_tan.rb', line 33 def email @email end |
#password ⇒ Object (readonly)
#initialize Arguments:
email: (String)
password: (String)
#let_gods_know_about Arguments:
gods: Array of emails (Strings)
subject: (String)
body: (String)
33 34 35 |
# File 'lib/hermes_tan.rb', line 33 def password @password end |
Instance Method Details
#let_gods_know_about(gods, subject, body) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/hermes_tan.rb', line 43 def let_gods_know_about(gods, subject, body) gmail = Gmail.new(email, password) gmail.deliver do to gods subject subject text_part do body body end end gmail.logout end |