Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip (flip) Kromer committed Mar 29, 2012
1 parent 3e55f2a commit e1a1b85
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions ruby-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,31 @@ You can generate a PDF or an HTML copy of this guide using
```
* Indent `protected`, `public`, `private` and `module_function` at the same
level as the enclosing declaration:
```Ruby
module Validations
def valid?(context = nil)
current_context, self.validation_context = validation_context, context
errors.clear
run_validations!
ensure
self.validation_context = current_context
end
# ...
protected
level as the enclosing declaration.
- good:
def run_validations!
run_callbacks :validate
errors.empty?
```Ruby
module Validations
def valid?(context = nil)
current_context, self.validation_context = validation_context, context
errors.clear
run_validations!
ensure
self.validation_context = current_context
end
# ...
protected
def run_validations!
run_callbacks :validate
errors.empty?
end
end
end
```
```
- bad (easy to read past):
Expand Down

0 comments on commit e1a1b85

Please sign in to comment.