Class: FashionPolice::SpacesAroundArgumentsInForLoops

Inherits:
Object
  • Object
show all
Defined in:
lib/fashion-police.rb

Instance Method Summary collapse

Instance Method Details

#error_messageObject



75
76
77
# File 'lib/fashion-police.rb', line 75

def error_message
  "Put spaces around for loop arguments"
end

#test(string) ⇒ Object



69
70
71
72
73
# File 'lib/fashion-police.rb', line 69

def test(string)
  return false if string.match(/for\(\S+\s+[^\)]+\)/)
  return false if string.match(/for \(\S+\s+/)
  return true
end