class ActiveSupport::Duration

def in_hours

1.day.in_hours # => 24.0

Returns the amount of hours a duration covers as a float
def in_hours
  in_seconds / SECONDS_PER_HOUR.to_f
end