Class: Kaui::Base
- Inherits:
-
Object
- Object
- Kaui::Base
- Defined in:
- app/models/kaui/base.rb
Class Method Summary collapse
Class Method Details
.to_money(amount, currency) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/models/kaui/base.rb', line 5 def self.to_money(amount, currency) if currency.present? begin return Money.from_amount(amount.to_f, currency) rescue StandardError => _e # Pass through end end Money.from_amount(amount.to_f, 'USD') end |