Class: FashionPolice::SpacesAroundArgumentsInAngleBrackets

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

Instance Method Summary collapse

Instance Method Details

#error_messageObject



116
117
118
# File 'lib/fashion-police.rb', line 116

def error_message
  "Put spaces around arguments inside angle brackets"
end

#test(string) ⇒ Object



109
110
111
112
113
114
# File 'lib/fashion-police.rb', line 109

def test(string)
  return true if string.match(/\{ .* \}/)
  return false if string.match(/\{[^\}]+\}/)

  return true
end