diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-02 13:10:18 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-02 13:10:18 -0200 |
commit | bc8cc56a2ae0b73276782d66b7dceba1ecd294a2 (patch) | |
tree | 61372ff245fc96d89b3f94428556ba90f460840a /activesupport/test/option_merger_test.rb | |
parent | 9fd6011f40a0fb7792867ef1a48ac0dbbb2ffee0 (diff) | |
download | rails-bc8cc56a2ae0b73276782d66b7dceba1ecd294a2.tar.gz rails-bc8cc56a2ae0b73276782d66b7dceba1ecd294a2.tar.bz2 rails-bc8cc56a2ae0b73276782d66b7dceba1ecd294a2.zip |
Prefer object/nil over `true`/`false`
This is the project guideline and the reasons are:
* That follows standard Ruby semantics.
* Allows the implementation to avoid artificial code like !! or something ? true : false
* You do not need to rely on the exact type of 3rd party code. For
example, if your method returns str.end_with?('foo') you do not need to
make sure end_with? returns a singleton. Your predicate just propagates
predicate semantics up regardless of what end_with? returns.
Diffstat (limited to 'activesupport/test/option_merger_test.rb')
0 files changed, 0 insertions, 0 deletions