Class: Pippi::Checks::SelectFollowedByEmpty::Documentation
- Inherits:
-
Object
- Object
- Pippi::Checks::SelectFollowedByEmpty::Documentation
- Defined in:
- lib/pippi/checks/select_followed_by_empty.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
15 16 17 |
# File 'lib/pippi/checks/select_followed_by_empty.rb', line 15 def description "Don't use select followed by empty?; use none? instead" end |
#instead_use ⇒ Object
21 22 23 |
# File 'lib/pippi/checks/select_followed_by_empty.rb', line 21 def instead_use "[1,2,3].none? {|x| x > 1 }" end |
#sample ⇒ Object
18 19 20 |
# File 'lib/pippi/checks/select_followed_by_empty.rb', line 18 def sample "[1,2,3].select {|x| x > 1 }.empty?" end |