jackc / jackc/tod

output of subtraction and addition

Open
#40 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Ruby
Stars
447
Forks
56
PR merge metrics
No merged PRs in 30d

Description

I was surprised to find that a duration is represented with a `Tod::TimeOfDay`. This seems semantically incorrect. It seems it should be either some sort of new class representing a period of time or just a float representing seconds, as is done in other libraries.

Would you be open to changing this behavior for the next major version release?

```
> noon = Tod::TimeOfDay.new(12)
> afternoon = Tod::TimeOfDay.new(14)
> d = afternoon-noon
=> #
> d.to_i / 60 / 60
=> 2
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the subtraction example with Tod::TimeOfDay and inspect how addition, subtraction, and to_i represent durations. The issue leaves the replacement type undecided, so research the existing behavior and comparable Ruby libraries before proposing a design for the next major release.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.