Class: Taw::Calculator

Inherits:
Object
  • Object
show all
Defined in:
lib/taw.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Calculator

Returns a new instance of Calculator.



16
17
18
# File 'lib/taw.rb', line 16

def initialize(opts)
  @approx_units = opts[:approx]
end

Instance Method Details

#time_ago_in_words(time) ⇒ Object



20
21
22
23
24
# File 'lib/taw.rb', line 20

def time_ago_in_words(time)
  self.distance = Time.now - time
  calculate_distance
  output_distance
end