{"action":"created","issue":{"url":"https://api.github.com/repos/kylewlacy/timerizer/issues/7","repository_url":"https://api.github.com/repos/kylewlacy/timerizer","labels_url":"https://api.github.com/repos/kylewlacy/timerizer/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/kylewlacy/timerizer/issues/7/comments","events_url":"https://api.github.com/repos/kylewlacy/timerizer/issues/7/events","html_url":"https://github.com/kylewlacy/timerizer/pull/7","id":317314705,"number":7,"title":"Add Duration#to_rounded_s method","user":{"login":"jdickey","id":157938,"avatar_url":"https://avatars3.githubusercontent.com/u/157938?v=4","gravatar_id":"","url":"https://api.github.com/users/jdickey","html_url":"https://github.com/jdickey","followers_url":"https://api.github.com/users/jdickey/followers","following_url":"https://api.github.com/users/jdickey/following{/other_user}","gists_url":"https://api.github.com/users/jdickey/gists{/gist_id}","starred_url":"https://api.github.com/users/jdickey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdickey/subscriptions","organizations_url":"https://api.github.com/users/jdickey/orgs","repos_url":"https://api.github.com/users/jdickey/repos","events_url":"https://api.github.com/users/jdickey/events{/privacy}","received_events_url":"https://api.github.com/users/jdickey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-24T17:01:57Z","updated_at":"2018-04-26T18:12:11Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/kylewlacy/timerizer/pulls/7","html_url":"https://github.com/kylewlacy/timerizer/pull/7","diff_url":"https://github.com/kylewlacy/timerizer/pull/7.diff","patch_url":"https://github.com/kylewlacy/timerizer/pull/7.patch"},"body":"This (internally) creates a copy of a Duration instance that has been\r\ntruncated so that at most two unit values are included, *and* rounded\r\nfrom the original value so that those values are influenced as needed by\r\nany additional values in the original.\r\n\r\nFor example:\r\n\r\n```ruby\r\n    t1 = (3.hours).to_rounded_s # \"3 hours\"\r\n    t2 = (3.hours 49.seconds).to_rounded_s # \"3 hours, 49 seconds\"\r\n    t3 = (3.hours 59.minutes 31.seconds)\r\n    t3.to_rounded_s # \"4 hours\"\r\n    t3.to_s # \"3 hours, 59 minutes, 31 seconds\"\r\n```\r\n\r\nThe actual value of the Duration instance on which this method is called\r\nis *not* affected."},"comment":{"url":"https://api.github.com/repos/kylewlacy/timerizer/issues/comments/384737685","html_url":"https://github.com/kylewlacy/timerizer/pull/7#issuecomment-384737685","issue_url":"https://api.github.com/repos/kylewlacy/timerizer/issues/7","id":384737685,"user":{"login":"jdickey","id":157938,"avatar_url":"https://avatars3.githubusercontent.com/u/157938?v=4","gravatar_id":"","url":"https://api.github.com/users/jdickey","html_url":"https://github.com/jdickey","followers_url":"https://api.github.com/users/jdickey/followers","following_url":"https://api.github.com/users/jdickey/following{/other_user}","gists_url":"https://api.github.com/users/jdickey/gists{/gist_id}","starred_url":"https://api.github.com/users/jdickey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdickey/subscriptions","organizations_url":"https://api.github.com/users/jdickey/orgs","repos_url":"https://api.github.com/users/jdickey/repos","events_url":"https://api.github.com/users/jdickey/events{/privacy}","received_events_url":"https://api.github.com/users/jdickey/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T18:12:11Z","updated_at":"2018-04-26T18:12:11Z","author_association":"NONE","body":"Right; that last commit solves the units-confusion bug that led me to write the [**not ready** comment](#issuecomment-384690936) above. The `#to_rounded_s` method should now Work Just Fine™.\r\n\r\nI still stand by the [\"other shoe dropping\" comment](#issuecomment-384711439) earlier; that `#to_units` behaviour is *odd.*"}}
{"actor":{"display_login":"jdickey"}}