module ItemPrinter

This module takes in an item and returns a string.

Public Class Methods

to_string(item, index) click to toggle source
# File lib/item_printer.rb, line 4
def self.to_string(item, index)
  str = "#{index}. "
  str << item.keys.map { |key| item[key].to_s }.join(' ')
end
to_summary(item, keys, index) click to toggle source
# File lib/item_printer.rb, line 9
def self.to_summary(item, keys, index)
  str = "#{index}. "
  str << keys.map { |key| item[key].to_s }.join(' ')
end