solidus
https://github.com/solidusio/solidus
Ruby
🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
Spree::DisplayMoney#money_methods
Takes a list of methods that the base object wants to be able to use
to display with Spree::Money, and turns them into display_* methods.
Intended to help clean up some of the presentational logic that exists
at the model layer.
==== Examples
Decorate a method, with the default option of using the base object's
currency
extend Spree::DisplayMoney
money_methods :tax_amount, :price
Decorate a method, but with some additional options
extend Spree::DisplayMoney
money_methods tax_amount: { currency: "CAD", no_cents: true }, :priceEdit
git clone [email protected]:solidusio/solidus.git
cd solidus
open core/app/models/concerns/spree/display_money.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Spree--DisplayMoney-money_methods-for-pr
# Commit to gitgit add core/app/models/concerns/spree/display_money.rbgit commit -m "better docs for Spree::DisplayMoney#money_methods"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Spree--DisplayMoney-money_methods-for-pr
hub pull-request
# Celebrate!