Class: Kaui::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/kaui/base.rb

Class Method Summary collapse

Class Method Details

.to_money(amount, currency) ⇒ Object



3
4
5
6
7
8
9
# File 'app/models/kaui/base.rb', line 3

def self.to_money(amount, currency)
  begin
    return Money.from_amount(amount.to_f, currency)
  rescue => _
  end if currency.present?
  Money.from_amount(amount.to_f, 'USD')
end