module WhatTheGem::I

I for Internal @private

Constants

Pastel

Public Instance Methods

ago_text(tm) click to toggle source
# File lib/whatthegem/i.rb, line 49
def ago_text(tm)
  diff = TimeCalc.now.-(tm).factorize
  unit, num = diff.detect { |_, v| !v.zero? }
  "#{num} #{unit}#{'s' unless num == 1} ago"
end