{"id":20543978,"url":"https://github.com/drewmoore/currency_chameleon","last_synced_at":"2025-10-23T17:42:50.207Z","repository":{"id":78372069,"uuid":"76134384","full_name":"drewmoore/currency_chameleon","owner":"drewmoore","description":"This is a tool for calculating and displaying monetary values in multiple currencies.","archived":false,"fork":false,"pushed_at":"2016-12-11T21:46:47.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T15:37:26.598Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drewmoore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-10T19:54:26.000Z","updated_at":"2020-03-19T09:27:09.000Z","dependencies_parsed_at":"2023-05-26T18:00:17.936Z","dependency_job_id":null,"html_url":"https://github.com/drewmoore/currency_chameleon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fcurrency_chameleon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fcurrency_chameleon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fcurrency_chameleon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fcurrency_chameleon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewmoore","download_url":"https://codeload.github.com/drewmoore/currency_chameleon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242150748,"owners_count":20080006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-11-16T01:41:51.429Z","updated_at":"2025-10-23T17:42:50.150Z","avatar_url":"https://github.com/drewmoore.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/drewmoore/currency_chameleon.svg?branch=master)](https://travis-ci.org/drewmoore/currency_chameleon)\n\n# Currency Chameleon\n\nThis is a simple currency tool for converting, calculating, and comparing monetary values between currencies.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'currency_chameleon', git: 'git://github.com/drewmoore/currency_chameleon'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nFirst, you will need to setup a table of conversion rates between currencies. For example:\n```ruby\nCurrencyChameleon::Money.conversion_rates(\n  'EUR', 'USD' =\u003e 1.05507, 'Bitcoin' =\u003e 0.00137\n)\n```\n\nThen, you can instantiate a new CurrencyChameleon::Money object in a currency:\n\n`euros = CurrencyChameleon::Money.new(23, 'EUR')`\n\nTo simply return the amount:\n\n`euros.amount # =\u003e 23`\n\nor return the currency:\n\n`euros.currency # =\u003e \"EUR\"`\n\nYou can also convert the amount to a secondary currency, which returns a new money instance:\n```ruby\ndollars = euros.convert_to('USD') # =\u003e 24.27 USD\ndollars.currency # =\u003e \"USD\"\n```\n\nMoney objects can perform mathematical operations between currencies, returning an instance in base currency:\n```ruby\ndollars = CurrencyChameleon::Money.new(47, 'USD')\neuros   = CurrencyChameleon::Money.new(12, 'EUR')\ntotal   = dollars + euros # =\u003e 59.66 USD\n\ntotal.class # =\u003e CurrencyChameleon::Money\n```\n\nMoney objects can also be compared against each other with any operator:\n```ruby\neuros    = CurrencyChameleon::Money.new(2, 'EUR')\nbitcoins = CurrencyChameleon::Money.new(2, 'Bitcoin')\n\neuros == bitcoins # =\u003e false\neuros \u003e bitcoins  # =\u003e false\neuros \u003c bitcoins  # =\u003e true\n```\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewmoore%2Fcurrency_chameleon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewmoore%2Fcurrency_chameleon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewmoore%2Fcurrency_chameleon/lists"}