A simple coding style for slightly more readable Ruby: symbols as flag arguments.
Use a symbol with a meaningful name instead of
true. This makes it clear what you're doing and is just as terse. For example:
def run(log_it = false) log_action if log_it run_action end command.run(true) # mysterious use of `true` command.run(:with_logging) # obvious
The second call to #run is functionally equivalent to the first, because every symbol is a truthy value. But it's a lot easier to read the code with the symbol and understand what the argument means.
The other common pattern I see in Rails is to use an options hash. That call would look like
command.run(:with_logging => true)
If you have a bunch of options, that's fine. When it's just a single optional flag, I prefer passing a symbol with a meaningful name.