module ItemListPrinter
Public Class Methods
to_string(items, item_printer = ItemPrinter)
click to toggle source
# File lib/item_list_printer.rb, line 5 def self.to_string(items, item_printer = ItemPrinter) items.each_with_index .map { |item, index| item_printer.to_string(item, index + 1) } .join("\n") end
to_summary(items, keys, item_printer = ItemPrinter)
click to toggle source
# File lib/item_list_printer.rb, line 11 def self.to_summary(items, keys, item_printer = ItemPrinter) items.each_with_index .map { |item, index| item_printer.to_summary(item, keys, index + 1) } .join("\n") end