Class: Pippi::Checks::SelectFollowedByFirst::Documentation
- Inherits:
-
Object
- Object
- Pippi::Checks::SelectFollowedByFirst::Documentation
- Defined in:
- lib/pippi/checks/select_followed_by_first.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
27 28 29 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 27 def description "Don't use select followed by first; use detect instead" end |
#instead_use ⇒ Object
35 36 37 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 35 def instead_use '[1,2,3].detect {|x| x > 1 }' end |
#sample ⇒ Object
31 32 33 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 31 def sample '[1,2,3].select {|x| x > 1 }.first' end |