About

Gem version Build status Coverage status CodeClimate status YARD documentation

Hour class to work with hours, minutes and seconds, convert between various units and format the output. Here's version of this library for Crystal: hour-crystal.

Installation

gem install hour-ruby

Usage

require "hour"

hour = Hour.from(minutes: 85)
puts "It's #{hour.hours.value}:#{hour.minutes.value}!"

hour = Hour.new(1, 25) + Hour.new(s: 10)
puts "It's #{hour.to_s}!"

puts "The system time is #{Hour.now}!"

Development

Use vagrant up to start a VM. Once everything's ready, it's vagrant ssh. Upon login, you'll be connected to a tmux session. To sleep, it's vagrant suspend.

TODO

  • Rubocop.
  • Release version 0.1.