Class: Pippi::Checks::ReverseFollowedByEach::Documentation

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

Instance Method Summary collapse

Instance Method Details

#descriptionObject



39
40
41
# File 'lib/pippi/checks/reverse_followed_by_each.rb', line 39

def description
  "Don't use reverse followed by each; use reverse_each instead"
end

#instead_useObject



47
48
49
# File 'lib/pippi/checks/reverse_followed_by_each.rb', line 47

def instead_use
  '[1,2,3].reverse_each {|x| x+1 }'
end

#sampleObject



43
44
45
# File 'lib/pippi/checks/reverse_followed_by_each.rb', line 43

def sample
  '[1,2,3].reverse.each {|x| x+1 }'
end