Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions ruby/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
# Ruby

- Avoid conditional modifiers (lines that end with conditionals).
- Avoid multiple assignments per line (`one, two = 1, 2`).
- Avoid organizational comments (`# Validations`).
- Avoid ternary operators (`boolean ? true : false`). Use multi-line `if`
instead to emphasize code branches.
- Avoid bang (!) method names. Prefer descriptive names.
- Name variables created by a factory after the factory (`user_factory` creates
`user`).
- Prefer nested class and module definitions over the shorthand version
- Prefer `detect` over `find`.
- Prefer `select` over `find_all`.
- Prefer `map` over `collect`.
- Prefer `reduce` over `inject`.
- Prefer `&:method_name` to `{ |item| item.method_name }` for simple method
calls.
- Use `_` for unused block parameters.
- Prefix unused variables or parameters with underscore (`_`).
- Suffix variables holding a factory with `_factory` (`user_factory`).
- Use `%()` for single-line strings containing double-quotes that require
interpolation.
- Use `?` suffix for predicate methods.
- Prefer `def self.method`, over `class << self`.
- Use `def` with parentheses when there are arguments.
- Use heredocs for multi-line strings.
- Order class methods above instance methods.
- Prefer method invocation over instance variables.
- Avoid optional parameters. Does the method do too much?
- Avoid monkey-patching.
- Generate necessary [Bundler binstubs] for the project, such as `rake` and
Expand Down