Class: Codeball::ExtractionSummary
- Inherits:
-
Object
- Object
- Codeball::ExtractionSummary
- Defined in:
- lib/codeball/extraction_summary.rb
Overview
Aggregates results from extracting multiple entries. Pure data class - no output methods.
Instance Attribute Summary collapse
-
#malformed ⇒ Object
readonly
Returns the value of attribute malformed.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #dry_run? ⇒ Boolean
- #extracted ⇒ Object
-
#initialize(results, malformed: 0) ⇒ ExtractionSummary
constructor
A new instance of ExtractionSummary.
- #skipped ⇒ Object
Constructor Details
#initialize(results, malformed: 0) ⇒ ExtractionSummary
Returns a new instance of ExtractionSummary.
8 9 10 11 |
# File 'lib/codeball/extraction_summary.rb', line 8 def initialize(results, malformed: 0) @results = results @malformed = malformed end |
Instance Attribute Details
#malformed ⇒ Object (readonly)
Returns the value of attribute malformed.
6 7 8 |
# File 'lib/codeball/extraction_summary.rb', line 6 def malformed @malformed end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
6 7 8 |
# File 'lib/codeball/extraction_summary.rb', line 6 def results @results end |
Instance Method Details
#dry_run? ⇒ Boolean
15 |
# File 'lib/codeball/extraction_summary.rb', line 15 def dry_run? = results.any? { it.status == :dry_run } |
#extracted ⇒ Object
13 |
# File 'lib/codeball/extraction_summary.rb', line 13 def extracted = results.count(&:success?) |
#skipped ⇒ Object
14 |
# File 'lib/codeball/extraction_summary.rb', line 14 def skipped = results.count { !it.success? } |