Class: Moult::HealthReport::ComponentView

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

Overview

One component of the composite, as serialized. present false means the analysis was skipped (e.g. no --coverage) or errored; then score and normalized_weight are null and diagnostic says why.

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



19
20
21
# File 'lib/moult/health_report.rb', line 19

def category
  @category
end

#diagnosticObject

Returns the value of attribute diagnostic

Returns:

  • (Object)

    the current value of diagnostic



19
20
21
# File 'lib/moult/health_report.rb', line 19

def diagnostic
  @diagnostic
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



19
20
21
# File 'lib/moult/health_report.rb', line 19

def name
  @name
end

#normalized_weightObject

Returns the value of attribute normalized_weight

Returns:

  • (Object)

    the current value of normalized_weight



19
20
21
# File 'lib/moult/health_report.rb', line 19

def normalized_weight
  @normalized_weight
end

#presentObject

Returns the value of attribute present

Returns:

  • (Object)

    the current value of present



19
20
21
# File 'lib/moult/health_report.rb', line 19

def present
  @present
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



19
20
21
# File 'lib/moult/health_report.rb', line 19

def reasons
  @reasons
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



19
20
21
# File 'lib/moult/health_report.rb', line 19

def score
  @score
end

#summaryObject

Returns the value of attribute summary

Returns:

  • (Object)

    the current value of summary



19
20
21
# File 'lib/moult/health_report.rb', line 19

def summary
  @summary
end

#weightObject

Returns the value of attribute weight

Returns:

  • (Object)

    the current value of weight



19
20
21
# File 'lib/moult/health_report.rb', line 19

def weight
  @weight
end

Instance Method Details

#to_hObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/moult/health_report.rb', line 21

def to_h
  {
    name: name,
    category: category,
    present: present,
    score: score,
    weight: weight,
    normalized_weight: normalized_weight,
    summary: summary,
    reasons: reasons.map(&:to_h),
    diagnostic: diagnostic
  }
end