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
42 43 44 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 42 def description "Don't use select followed by first; use detect instead" end |
#instead_use ⇒ Object
50 51 52 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 50 def instead_use '[1,2,3].detect {|x| x > 1 }' end |
#sample ⇒ Object
46 47 48 |
# File 'lib/pippi/checks/select_followed_by_first.rb', line 46 def sample '[1,2,3].select {|x| x > 1 }.first' end |