im new to ruby and rails.
in RoR3 a controller inherits from the ActionController::Base
request.env["SERVER_ADDR"]
so request is a method in Base class (that is inside the ActionController module)?
what is env then and ["SERVER_ADDR"]?
would be great if someone could make a little code example…that would be very helpful to understand!
thanks!
requestis eithera. dereferencing the local variable
requestorb. sending the message
:requestwith no arguments to the implicit receiverself,envis sending the message:envwith no arguments to the object obtained by dereferencingrequestor the object returned in response to sending the message:requesttoselfin step 2,["SERVER_ADDR"]is sending the message:[]with the argument"SERVER_ADDR"to the object returned in response to sending the message:envin step 2 and"SERVER_ADDR"is a string literal.You could more explicitly write it like this:
or even more explicit like this:
and even full out: