Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

GoDuration for Ruby

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'go_duration'

And then execute:

$ bundle

Or install it yourself as:

$ gem install go_duration

Usage

Parsing

require 'go_duration'

GoDuration.parse("2m30s") # => 150

Generating

require 'go_duration'

GoDuration.generate(150) # => "2m30s"

require 'go_duration/core_ext'

150.to_go_duration # => "2m30"

require 'active_support/core_ext'

(2.hours + 45.minutes).to_go_duration # => "2h45m"

About

GoDuration Ruby Gem - Parses and generates Go's time.Duration format

Topics

Resources

You can’t perform that action at this time.