class ActiveSupport::Duration

def <=>(other)

Numeric values are treated as seconds.
Compares one Duration with another or a Numeric to this Duration.
def <=>(other)
  if Duration === other
    value <=> other.value
  elsif Numeric === other
    value <=> other
  end
end