Class: Moult::Confidence::Finding

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

Overview

A confidence-graded dead-code candidate. Carries its reasons so no claim is ever made without a recorded justification.

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



54
55
56
# File 'lib/moult/confidence.rb', line 54

def category
  @category
end

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



54
55
56
# File 'lib/moult/confidence.rb', line 54

def confidence
  @confidence
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



54
55
56
# File 'lib/moult/confidence.rb', line 54

def kind
  @kind
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



54
55
56
# File 'lib/moult/confidence.rb', line 54

def name
  @name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



54
55
56
# File 'lib/moult/confidence.rb', line 54

def path
  @path
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



54
55
56
# File 'lib/moult/confidence.rb', line 54

def reasons
  @reasons
end

#runtimeObject

Returns the value of attribute runtime

Returns:

  • (Object)

    the current value of runtime



54
55
56
# File 'lib/moult/confidence.rb', line 54

def runtime
  @runtime
end

#spanObject

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



54
55
56
# File 'lib/moult/confidence.rb', line 54

def span
  @span
end

#symbol_idObject

Returns the value of attribute symbol_id

Returns:

  • (Object)

    the current value of symbol_id



54
55
56
# File 'lib/moult/confidence.rb', line 54

def symbol_id
  @symbol_id
end

Instance Method Details

#to_hObject



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/moult/confidence.rb', line 57

def to_h
  {
    symbol_id: symbol_id,
    kind: kind.to_s,
    name: name,
    span: span.to_h,
    confidence: confidence,
    category: category,
    runtime: runtime&.to_s,
    reasons: reasons.map(&:to_h)
  }
end