Sha256: cba06e329323a3de2a595c34c988c86e2d3710597f779baaec68272a1888c36a

Contents?: true

Size: 823 Bytes

Versions: 5

Compression:

Stored size: 823 Bytes

Contents

= Conversions

The conversions plugin does a number of things. The core functionality is the unit conversion:

  1.miles.to(:kilometres) #=> 1.609344
  1.pounds.to(:kilograms) #=> 0.453592

It also adds a class method to ActiveRecord::Base that allows you to define conversion methods for attributes:

  class Car < ActiveRecord::Base
    conversion_accessor :weight, :internal => :kilograms, :external => :pounds
  end

  car = Car.new(:weight => 1500)
  car.weight_in_pounds #=> 3306.93393


== Installation

=== As a gem

Configure the gem in environment.rb:
  
  config.gem 'Fingertips-conversions', :lib => 'conversions', :source => 'http://gems.github.com'

Install them using Rails' rake task:

  $ rake gems:install

=== In your vendor directory:

  script/install plugin git://github.com/Fingertips/conversions.git

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
Fingertips-conversions-1.2.1 README
Fingertips-conversions-1.3.0 README
seamusabshere-conversions-1.2.1 README
seamusabshere-conversions-1.2.2 README
seamusabshere-conversions-1.3.0 README