Sha256: c247c0642b704595e9fad3e8eba5824d38b974fbbd7382184929dbcae6cdd711
Contents?: true
Size: 743 Bytes
Versions: 17
Compression:
Stored size: 743 Bytes
Contents
# encoding: utf-8 require 'html/pipeline' require 'task_list' class TaskList # Provides a summary of provided TaskList `items`. # # `items` is an Array of TaskList::Item objects. class Summary < Struct.new(:items) # Public: returns true if there are any TaskList::Item objects. def items? item_count > 0 end # Public: returns the number of TaskList::Item objects. def item_count items.size end # Public: returns the number of complete TaskList::Item objects. def complete_count items.select{ |i| i.complete? }.size end # Public: returns the number of incomplete TaskList::Item objects. def incomplete_count items.select{ |i| !i.complete? }.size end end end
Version data entries
17 entries across 17 versions & 2 rubygems