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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ Be consistent.
end

# okish
class FooError < StandardError; end
FooError = Class.new(StandardError)

# good
FooError = Class.new(StandardError)
class FooError < StandardError; end
```

* Avoid single-line methods. Although they are somewhat popular in the
Expand Down Expand Up @@ -748,7 +748,7 @@ Be consistent.
end

# less good, but reasonable if there is no reasonable means to determine
the positive case.
# the positive case.
# Prefer unless condition over ! condition
unless failure?
puts 'success'
Expand Down Expand Up @@ -1599,7 +1599,7 @@ impact, though, as the block gets converted to a Proc.
SOME_CONSTANT = 20

# inner public class
CustomErrorKlass = Class.new(StandardError)
class CustomErrorKlass < StandardError; end

# afterwards we have attribute macros
attr_reader :name
Expand Down