Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Unite provides module extensions to your ruby objects for unit/value support.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.bundle
bin
lib
spec
.gitignore
.rspec
.ruby-version
Gemfile
Gemfile.lock
Guardfile
MIT-LICENSE
README.md
Rakefile
unite.gemspec

README.md

Install

With Bundler

gem 'unite'

Without Bundler

gem install unite

It's Science

It's Science

Based on the algorithms developed by Gordon S. Novak, Jr. at the University of Texas, which can be found here:

http://www.cs.utexas.edu/users/novak/units95.html

Dimensions

Handles the following dimensions:

[:length, :time, :temperature, :mass, :current, :substance, :luminosity, :money]

Note: Conversion of Money is not currently supported.

Can use Unite::Quantity to represent values or include the functionality into your own objects.

Look at https://github.com/stellard/unite/blob/master/lib/unite/quantity.rb for a minum implementation

Examples:

TODO: Needs more info here.

Unite::Quantity.init("1000*km")
Unite::Quantity.init("1000","km")

Unit definitions are found here:

https://github.com/stellard/unite/blob/master/lib/unite/lookup/definitions.rb

Specs show good examples of use.

Something went wrong with that request. Please try again.