Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

just_time

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just_time

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

JustTime

A class to represent a time object without a date. Ruby doesn't have one, and if you don't want to rely on, eg, Sequel.SQLTime, then you have to roll your own.

Or you can use mine. ;)

Installation

Add this line to your application's Gemfile:

gem 'just_time'

And then execute:

$ bundle

Or install it yourself as:

$ gem install just_time

Usage

The code is very short and hopefully the whole thing is pretty obvious. Some example code:


jt1 = JustTime.new("12:34:56")
jt2 = JustTime.from_time(Time.now - 120)
jt3 = JustTime.now

jt4 = jt1 - jt2
puts jt2.to_s(:hhmm)
date = jt2.to_time(Date.today)

Thanks

This code was developed, by me, during working hours at James Hall & Co. Ltd. I'm incredibly greatful that they have permitted me to open-source it.

FAQs

Package last updated on 17 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc