Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A really simple currency converter using XavierMedia API. Compatible with Ruby 1.8, 1.9, JRuby 1.5.3 and Rubinius 1.1
Ruby
tag: v1.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.bundle
autotest
lib
spec
.autotest
.gitignore
.rspec
.rvmrc
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
VERSION
simple_currency.gemspec

README.rdoc

simple_currency

A really simple currency converter using Xurrency API. Compatible with Ruby 1.8, 1.9 and JRuby.

Installation

Rails 3

In your Gemfile:

gem "simple_currency"

Not using Rails?

Then you have to manually install the gem:

gem install simple_currency

And manually require it as well:

require "simple_currency"

Usage

Now all your numeric stuff gets this fancy DSL for free:

30.eur.to_usd
# => 38.08

150.eur.to_usd
# => 190.4
# This one doesn't even hit Xurrency API,
# it takes advantage of Rails cache!

70.usd.to_chf
# => 71.9

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add specs for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull.

  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2010 Codegram. See LICENSE for details.

Something went wrong with that request. Please try again.