Skip to content

Commit

Permalink
Use :: only to reference constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozhidar Batsov committed May 5, 2013
1 parent 321df92 commit f657893
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -384,6 +384,20 @@ as easy to spots as regular comments.

## Syntax

* Use `::` only to reference constants(this includes classes and
modules). Never use `::` for method invocation.

```Ruby
# bad
SomeClass::some_method
some_object::some_method

# good
SomeClass.some_method
some_object.some_method
SomeModule::SomeClass::SOME_CONST
```

* Use `def` with parentheses when there are arguments. Omit the
parentheses when the method doesn't accept any arguments.

Expand Down

0 comments on commit f657893

Please sign in to comment.