Skip to content

Add method for cents-based check#1125

Merged
yukideluxe merged 9 commits intoRubyMoney:mainfrom
jozr:main
Jul 9, 2025
Merged

Add method for cents-based check#1125
yukideluxe merged 9 commits intoRubyMoney:mainfrom
jozr:main

Conversation

@jozr
Copy link
Contributor

@jozr jozr commented Apr 3, 2025

This seems like a useful addition to the currency class. Let me know what you think. Happy to add more or close depending on feedback.

@jozr
Copy link
Contributor Author

jozr commented Apr 21, 2025

@semmons99 can we get this one in?

@semmons99
Copy link
Member

yes. we just need help getting CI/CD functioning again. something broke somewhere along the line on all RubyMoney org repos

Copy link
Member

@sunny sunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an entry to the Changelog and an example in the Readme as well? 🙏🏻

@jozr
Copy link
Contributor Author

jozr commented Jun 30, 2025

@sunny @Sija thanks for the reviews

It didn't seem worth an example in the README given that no other conditional methods are mentioned there, but let me know if you want that to change.

@sunny
Copy link
Member

sunny commented Jun 30, 2025

Thank you!

If we wanted to add it to the README we could go for a new line under Currency like so:

currency = Money.from_cents(1000, "USD").currency
currency.iso_code # => "USD"
currency.name # => "United States Dollar"
currency.cents_based? # => true

I don’t think it needs a whole paragraph of explanation, but can be helpful for people looking for something similar.

@jozr
Copy link
Contributor Author

jozr commented Jun 30, 2025

@sunny done!

Copy link
Member

@sunny sunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 👏🏻

Copy link
Member

@yukideluxe yukideluxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏻 I'll edit the CHANGELOG to include this in the upcoming 7.0 release ✌🏻

@yukideluxe yukideluxe merged commit d386a4b into RubyMoney:main Jul 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants