Class: Pippi::Checks::SelectFollowedByEmpty::Documentation

Inherits:
Object
  • Object
show all
Defined in:
lib/pippi/checks/select_followed_by_empty.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



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_useObject



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

#sampleObject



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