R
Rail Shafigulin
i'm somewhat new to rails and ruby.
whenever i create a new object in ruby i use
o = ClassName.new
but recently i bumped into the following code (in rails)
rating = Rating.newrating => params[:rating])
i can't understand what it means. i looked at the class definition for
Rating and didn't see any attributes or methods named rating. i also
didn't see the constructor in there (i.e. initialize method) i would
really appreciate if someone offer an explanation of what is happening
and if there are more ways of creating an object.
any help is appreciated
whenever i create a new object in ruby i use
o = ClassName.new
but recently i bumped into the following code (in rails)
rating = Rating.newrating => params[:rating])
i can't understand what it means. i looked at the class definition for
Rating and didn't see any attributes or methods named rating. i also
didn't see the constructor in there (i.e. initialize method) i would
really appreciate if someone offer an explanation of what is happening
and if there are more ways of creating an object.
any help is appreciated