This is not a task. In Ruby, jobs are executed using the assignment operator = as follows:
var = val
You are probably thinking of some Lisp dialects where the assignment is as follows:
(def var val)
This is just a useless post message.
In Ruby, the general syntax for sending a message is
receiver.selector(argument1, argument2)
However, if receiver is self , you can leave receiver , therefore
selector(argument1, argument2)
coincides with
self.selector(argument1, argument2)
[Note: this is not entirely true. In Ruby, private methods can only be called when sending a message without a receiver, so if in this example self responds to a selector message by calling a private method, only the first option will work, the second will raise a NoMethodError exception.]
In addition, in cases where there is no ambiguity, you can leave parentheses around such arguments:
receiver.selector argument1, argument2
If you put two things together, you can now see that
selector argument1, argument2
equivalently
self.selector(argument1, argument2)
and therefore
from "Some text for this field"
equivalently
self.from("Some text for this field")
There is a third shortcut in the syntax for sending a Ruby message: if the most recent argument for sending the message is a Hash literal, then you can leave curly braces. Thus, the last line in the above example can also be written as
body :user => user, :url => "http://example.com/login"
In addition, in Ruby 1.9, the letter Hash , where all Symbol keys can be written using alternative Hash syntax:
{ key1: val1, key2: val2 }
matches old syntax
{ :key1 => val1, :key2 => val2 }
which means that, at least in Ruby 1.9, this last line can also be written as
body user: user, url: "http://example.com/login"