Class: Time

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

Overview

A new method to print time as text.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2024-2025 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Instance Method Details

#ago(arg = Time.now, *options) ⇒ Object



117
118
119
120
121
122
123
124
125
# File 'lib/tago.rb', line 117

def ago(arg = Time.now, *options)
  if arg.is_a?(Time)
    now = arg
  else
    now = Time.now
    options = [arg] + options
  end
  (now - self).seconds(*options)
end