Skip to content

jahl/Cochimetl

Cochimetl

Gem Version Maintainability

A simple Ruby gem to deal with the nightmare that is Banxico

Installation

Add this line to your app's Gemfile:

gem 'Cochimetl'

Then you can just run:

$ bundle

Or install it yourself with:

gem install Cochimetl

Usage

I tried to keep it simple, for example, to make a new currency object in pesos just use:

Cochimetl.new(1, :mxn)

You can do any basic arithmetic with your currency object:

currency = Cochimetl.new(1, :mxn)
currency * 2 # currency.value * 2
currency + 1 # currency.value + 1
currency.value # 3

Oh, you can also exchange the value to any of the supported currencies:

currency.to(:usd)

In case you need a refresher on which currencies are supported, you can easily check with:

Cochimetl.currencies

That pretty much covers it!

Contributing

  1. Create a fork.
  2. Make your own feature branch like this: git checkoyt -b feature/my-cool-feature
  3. Make sure to add some nice specs to your work!
  4. Commit your changes git commit -am "Add some cool changes"
  5. Push the branch like this git push origin feature/my-cool-feature
  6. You can create a pull request to this repo!

Made with ❤️

About

A simple Ruby gem to deal with the nightmare that is Banxico.

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors