Sha256: 199859a03c6b317151482367a3e8b3118a1e12d2358cddf2a5ec88b61f1883f9
Contents?: true
Size: 1.37 KB
Versions: 2
Compression:
Stored size: 1.37 KB
Contents
= simple_currency A really simple currency converter using Xurrency and XavierMedia APIs. Compatible with Ruby 1.8, 1.9 and JRuby. == Usage Just require it and all your numeric stuff gets this fancy DSL for free: 30.eur.to_usd # => 38.08 150.eur.to_usd # => 190.4 239.usd.to_eur # => 187.98 # These don't even hit the Internets! # (They take advantage of Rails cache) 70.usd.to_chf # => 71.9 But what if you want to do the currency exchange according to a specific date in the past? Just do this: # You can use any time or date object 42.eur.at(1.year.ago).to_usd # => 60.12 42.eur.at(Time.parse('2009-09-01')).to_usd # => 60.12 == 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" == 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 (c) 2010 Codegram. See LICENSE for details.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple_currency-1.1.2 | README.rdoc |
simple_currency-1.1.1 | README.rdoc |