Class: HTML::Pipeline::TaskList::Summary
- Inherits:
-
Struct
- Object
- Struct
- HTML::Pipeline::TaskList::Summary
- Defined in:
- lib/html/pipeline/task_list/summary.rb
Overview
Provides a summary of provided TaskList ‘items`.
‘items` is an Array of TaskList::Item objects.
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
-
#complete_count ⇒ Object
Public: returns the number of complete TaskList::Item objects.
-
#incomplete_count ⇒ Object
Public: returns the number of incomplete TaskList::Item objects.
-
#item_count ⇒ Object
Public: returns the number of TaskList::Item objects.
-
#items? ⇒ Boolean
Public: returns true if there are any TaskList::Item objects.
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items
11 12 13 |
# File 'lib/html/pipeline/task_list/summary.rb', line 11 def items @items end |
Instance Method Details
#complete_count ⇒ Object
Public: returns the number of complete TaskList::Item objects.
23 24 25 |
# File 'lib/html/pipeline/task_list/summary.rb', line 23 def complete_count items.select(&:complete?).size end |
#incomplete_count ⇒ Object
Public: returns the number of incomplete TaskList::Item objects.
28 29 30 |
# File 'lib/html/pipeline/task_list/summary.rb', line 28 def incomplete_count items.reject(&:complete?).size end |
#item_count ⇒ Object
Public: returns the number of TaskList::Item objects.
18 19 20 |
# File 'lib/html/pipeline/task_list/summary.rb', line 18 def item_count items.size end |
#items? ⇒ Boolean
Public: returns true if there are any TaskList::Item objects.
13 14 15 |
# File 'lib/html/pipeline/task_list/summary.rb', line 13 def items? item_count.positive? end |