U
Ugur
Hello there,
I am totally new to Ruby and saw this syntax which is creating a new instance from a class?
(quote)
mail = Mail.new do
to '(e-mail address removed)'
from '(e-mail address removed)'
subject 'testing sendmail'
body 'testing sendmail'
end
mail.deliver
(/quote)
This example is taken from [1]
The tokens "to, from, subject, body" are whitespace seperated from the values on the right hand side. But no comma or arrow in between.
Can anyone explain this syntax to me? I checked [2] and couldn't find anything similir.
Thanks for any help,
Ugur
[1] http://lindsaar.net/2010/3/15/how_to_use_mail_and_actionmailer_3_with_gmail_smtp
[2] http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_classes.html
I am totally new to Ruby and saw this syntax which is creating a new instance from a class?
(quote)
mail = Mail.new do
to '(e-mail address removed)'
from '(e-mail address removed)'
subject 'testing sendmail'
body 'testing sendmail'
end
mail.deliver
(/quote)
This example is taken from [1]
The tokens "to, from, subject, body" are whitespace seperated from the values on the right hand side. But no comma or arrow in between.
Can anyone explain this syntax to me? I checked [2] and couldn't find anything similir.
Thanks for any help,
Ugur
[1] http://lindsaar.net/2010/3/15/how_to_use_mail_and_actionmailer_3_with_gmail_smtp
[2] http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_classes.html