DEV Community

Discussion on: Keyword Arguments of Ruby makes code more clear

Collapse
 
burdettelamar profile image
Burdette Lamar

Seems right as shown, but perhaps only for .new?

For any other method:

  • If the parameters are related, could they form a class and be passed as an object?

  • If not, does the method lack a unified purpose?

Collapse
 
chenge profile image
chenge

Right, better params no more than 3. If more than 3 maybe should use hash or object.