Class: StyleViolation

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

Overview

Value object used by StyleCheck.

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



2
3
4
# File 'lib/cane/style_violation.rb', line 2

def file_name
  @file_name
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



2
3
4
# File 'lib/cane/style_violation.rb', line 2

def line
  @line
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



2
3
4
# File 'lib/cane/style_violation.rb', line 2

def message
  @message
end

Instance Method Details

#columnsObject



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

def columns
  ["%s:%i" % [file_name, line], message]
end

#descriptionObject



3
4
5
# File 'lib/cane/style_violation.rb', line 3

def description
  "Lines violated style requirements"
end