Class: Commissar::Finding

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



76
77
78
# File 'lib/commissar.rb', line 76

def category
  @category
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



76
77
78
# File 'lib/commissar.rb', line 76

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



76
77
78
# File 'lib/commissar.rb', line 76

def line
  @line
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



76
77
78
# File 'lib/commissar.rb', line 76

def message
  @message
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



76
77
78
# File 'lib/commissar.rb', line 76

def severity
  @severity
end

#snippetObject

Returns the value of attribute snippet

Returns:

  • (Object)

    the current value of snippet



76
77
78
# File 'lib/commissar.rb', line 76

def snippet
  @snippet
end

Instance Method Details

#to_sObject



81
82
83
84
85
# File 'lib/commissar.rb', line 81

def to_s
	loc = [file, line].compact.join(":")
	loc_str = loc.empty? ? "" : " => #{loc}"
	"[#{severity.ljust(4)}] #{message}#{loc_str}"
end

#weightObject



77
78
79
# File 'lib/commissar.rb', line 77

def weight
	SEVERITY_WEIGHT.fetch(severity, 0)
end