Module: WhatTheGem::I

Extended by:
I
Included in:
I
Defined in:
lib/whatthegem/i.rb

Overview

I for Internal

Defined Under Namespace

Modules: Callable, Kramdowns, RDocs

Constant Summary collapse

Pastel =
::Pastel.new

Instance Method Summary collapse

Instance Method Details

#ago_text(tm) ⇒ Object



50
51
52
53
54
# File 'lib/whatthegem/i.rb', line 50

def ago_text(tm)
  diff = TimeMath.measure(tm, Time.now)
  unit, num = diff.detect { |_, v| !v.zero? }
  "#{num} #{unit} ago"
end