Sha256: ad1e0e8587c74aed1e123e0d7f879c8e159caefb2d2a72c99e680c6adbd60c93

Contents?: true

Size: 328 Bytes

Versions: 1

Compression:

Stored size: 328 Bytes

Contents

##
# This module takes in an item and returns a string.
module ItemPrinter
  def self.to_string(item, index)
    str = "#{index}. "
    str << item.keys.map { |key| item[key].to_s }.join(' ')
  end

  def self.to_summary(item, keys, index)
    str = "#{index}. "
    str << keys.map { |key| item[key].to_s }.join(' ')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
item_list-0.1.2 lib/item_printer.rb