Skip to content

string output #24

@smcabrera

Description

@smcabrera

Currently outputting as a string gives you the following:

Duration.new(1000).to_s
=> "#<Duration:0x007fc7f28f5ce8>"

I'd love to implement a to_s function that would cause durations to output a little more like the way the Time class works:

Time.new.to_s
=> "2015-03-02 17:59:27 -0500"

Something like this:

Duration.new(1000).to_s
=> "00:16:40"

The only issue I can think of is that you allow for days and weeks and I'm not sure what format those should be outputted in...thoughts?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions