We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be438f8 commit a61cad1Copy full SHA for a61cad1
1 file changed
README.adoc
@@ -6259,6 +6259,21 @@ Write `ruby -w` safe code.
6259
Avoid hashes as optional parameters.
6260
Does the method do too much? (Object initializers are exceptions for this rule).
6261
6262
+[source,ruby]
6263
+----
6264
+# bad
6265
+def send_email(subject, opts = {})
6266
+ to = opts[:to]
6267
+ cc = opts[:cc]
6268
+ # ...
6269
+end
6270
+
6271
+# good
6272
+def send_email(subject, to:, cc: nil)
6273
6274
6275
6276
6277
=== Instance Vars [[instance-vars]]
6278
6279
Use module instance variables instead of global variables.
0 commit comments