-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid confusion with class methods and protected/private modifiers (#…
…1512) Working on something else, I saw the following: ```ruby protected # ... def self.field_type to_s.split("::").last.underscore end ``` This code can lead to misunderstanding, as the `protected` modifier doesn't apply to class methods like `self.field_type`. On this PR, I move two such class methods behind the modifier, near the top of the class, to avoid this confusion. I also move three other class methods to the top of the class, as I feel class methods should go together in general, in order to clarify interfaces and avoid future instances of this anti-pattern.
- Loading branch information
Showing
4 changed files
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters