class FashionPolice::FourSpaces

Public Instance Methods

error_message() click to toggle source
# File lib/fashion-police.rb, line 22
def error_message
  "Four spaces per indentation level"
end
test(string) click to toggle source
# File lib/fashion-police.rb, line 15
def test(string)
  spaces = string.match(/^(\s+)\S/)
  return true unless spaces && spaces[1]

  return (spaces[1].length % 4 == 0)
end