Class: Taw::Calculator
- Inherits:
-
Object
- Object
- Taw::Calculator
- Defined in:
- lib/taw.rb
Instance Method Summary collapse
-
#initialize(opts) ⇒ Calculator
constructor
A new instance of Calculator.
- #time_ago_in_words(time) ⇒ Object
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 |