Class: Moult::BoundariesReport::Finding

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

Overview

One recorded boundary-violation group: a (referencing_package, defining_package, constant, violation_type) tuple referenced from one or more files. Carries its severity and reasons so the classification is auditable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#constantObject

Returns the value of attribute constant

Returns:

  • (Object)

    the current value of constant



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def constant
  @constant
end

#defining_packageObject

Returns the value of attribute defining_package

Returns:

  • (Object)

    the current value of defining_package



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def defining_package
  @defining_package
end

#occurrencesObject

Returns the value of attribute occurrences

Returns:

  • (Object)

    the current value of occurrences



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def occurrences
  @occurrences
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def reasons
  @reasons
end

#referencing_packageObject

Returns the value of attribute referencing_package

Returns:

  • (Object)

    the current value of referencing_package



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def referencing_package
  @referencing_package
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def severity
  @severity
end

#violation_typeObject

Returns the value of attribute violation_type

Returns:

  • (Object)

    the current value of violation_type



32
33
34
# File 'lib/moult/boundaries_report.rb', line 32

def violation_type
  @violation_type
end

Instance Method Details

#to_hObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/moult/boundaries_report.rb', line 34

def to_h
  {
    category: Boundaries::Severity::CATEGORY,
    confidence: nil,
    violation_type: violation_type,
    severity: severity,
    referencing_package: referencing_package,
    defining_package: defining_package,
    constant: constant,
    reasons: reasons.map(&:to_h),
    occurrences: occurrences.map(&:to_h)
  }
end