Class: Moult::DuplicationReport::Finding

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

Overview

A confidence-graded clone group. Carries its reasons so no claim is made without a recorded justification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def confidence
  @confidence
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def kind
  @kind
end

#massObject

Returns the value of attribute mass

Returns:

  • (Object)

    the current value of mass



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def mass
  @mass
end

#node_typeObject

Returns the value of attribute node_type

Returns:

  • (Object)

    the current value of node_type



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def node_type
  @node_type
end

#occurrencesObject

Returns the value of attribute occurrences

Returns:

  • (Object)

    the current value of occurrences



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def occurrences
  @occurrences
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



25
26
27
# File 'lib/moult/duplication_report.rb', line 25

def reasons
  @reasons
end

Instance Method Details

#to_hObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/moult/duplication_report.rb', line 26

def to_h
  {
    category: Duplication::Confidence::CATEGORY,
    confidence: confidence,
    kind: kind.to_s,
    node_type: node_type,
    mass: mass,
    reasons: reasons.map(&:to_h),
    occurrences: occurrences.map(&:to_h)
  }
end