You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a common form to want to return a newly-constructed object with all the values set into it already, by having mutator methods that return the invocant, so you can easily add more. In such a style you could write:
As it currently stands, the existing mutator methods like ->header, ->content, etc.. do not return the invocant, thus such a style is impossible and one must use a temporary:
I fully agree on a approach that @leonerd describes, a very common way to do things in other languages. Bu I would strongly disagree with set_*mutators, because of 'inmutability'. I'd rather would go for with_* that would create a clone, with the new setting.
It's a common form to want to
return
a newly-constructed object with all the values set into it already, by having mutator methods that return the invocant, so you can easily add more. In such a style you could write:As it currently stands, the existing mutator methods like
->header
,->content
, etc.. do not return the invocant, thus such a style is impossible and one must use a temporary:The text was updated successfully, but these errors were encountered: