Class: FashionPolice::SpacesAroundArgumentsInFunctionDeclarations

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

Instance Method Summary collapse

Instance Method Details

#error_messageObject



141
142
143
# File 'lib/fashion-police.rb', line 141

def error_message
  "Put spaces around for loop arguments"
end

#test(string) ⇒ Object



135
136
137
138
139
# File 'lib/fashion-police.rb', line 135

def test(string)
  return true if string.match(/function( .+)?\( [^\)]+ \)/)
  return false if string.match(/function( .+)?\([^\)]+\)/)
  return true
end