Class: Pippi::Checks::SelectFollowedBySelect::Documentation

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

Instance Method Summary collapse

Instance Method Details

#descriptionObject



15
16
17
# File 'lib/pippi/checks/select_followed_by_select.rb', line 15

def description
  "Don't use consecutive select blocks; use a single select instead"
end

#instead_useObject



21
22
23
# File 'lib/pippi/checks/select_followed_by_select.rb', line 21

def instead_use
  "[1,2,3].select {|x| x > 2 }"
end

#sampleObject



18
19
20
# File 'lib/pippi/checks/select_followed_by_select.rb', line 18

def sample
  "[1,2,3].select {|x| x > 1 }.select {|x| x > 2 }"
end