Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby Money::Bank interface for the Google Currency exchange data

Merge pull request #32 from yinquanteo/master

add require 'monetize' and link to LICENSE file to README
latest commit e1ce0ec983
Yinquan (Yink) Teo yinquanteo authored

Google Currency

Build Status

This gem extends Money::Bank::VariableExchange with Money::Bank::GoogleCurrency and gives you access to the current Google Currency exchange rates.


require 'money'
require 'money/bank/google_currency'

# (optional)
# set the seconds after than the current rates are automatically expired
# by default, they never expire
Money::Bank::GoogleCurrency.ttl_in_seconds = 86400

# set default bank to instance of GoogleCurrency
Money.default_bank =

# create a new money object, and use the standard #exchange_to method
money =, "USD") # amount is in cents

# or install and use the 'monetize' gem
require 'monetize'
money = 1.to_money(:USD)

An UnknownRate will be thrown if #exchange_to is called with a Currency that Money knows, but Google does not.

An UnknownCurrency will be thrown if #exchange_to is called with a Currency that Money does not know.

A GoogleCurrencyFetchError will be thrown if there is an unknown issue with the Google Finance Converter API.


Copyright (c) 2011 Shane Emmons. See LICENSE for details.

Something went wrong with that request. Please try again.