ryanuber / go-duration-ruby

Golang duration parser/formatter for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-duration

go-duration is a gem which provides compatibility with Golang's time.Duration type strings.

Examples

From Golang's time.Duration:

d = GoDuration.parse("1m30s")
d.seconds
> 90

To Golang's time.Duration:

d = GoDuration::Duration.new(90)
d.to_s
> "1m30s"

About

Golang duration parser/formatter for Ruby

License:MIT License


Languages

Language:Ruby 100.0%