Class: Cane::SyntaxViolation

Inherits:
Struct
  • Object
show all
Defined in:
lib/cane/syntax_violation.rb

Overview

Value object used by AbcCheck for a file that cannot be parsed. This is handled by AbcCheck rather than a separate class since it is a low value violation (syntax errors should have been picked up by specs) but we still have to deal with the edge case.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name

Returns:

  • (Object)

    the current value of file_name



7
8
9
# File 'lib/cane/syntax_violation.rb', line 7

def file_name
  @file_name
end

Instance Method Details

#columnsObject



8
9
10
# File 'lib/cane/syntax_violation.rb', line 8

def columns
  [file_name]
end

#descriptionObject



12
13
14
# File 'lib/cane/syntax_violation.rb', line 12

def description
  "Files contained invalid syntax"
end

#sort_indexObject



16
17
18
# File 'lib/cane/syntax_violation.rb', line 16

def sort_index
  0
end