This line defines a method called req= . The = symbol at the end makes it an assignment method.
This is the usual setter method:
def foo(para1) @foo = para1 end
The setter method can be rewritten as an assignment method as follows:
def foo=(para1) @foo = para1 end
The difference between the two setter methods is the syntax of the call.
Appointment:
a.foo=("bar") #valid syntax a.foo= ("bar") #valid syntax a.foo = ("bar") #valid syntax a.foo= "bar" #valid syntax a.foo = "bar" #valid syntax
Regular Setter:
a.foo("bar") #valid syntax a.foo ("bar") #valid syntax a.fo o ("bar") #invalid syntax
Harish shetty
source share