Sha256: b41632c9788bb89b07cfe8eea58aca79d7d787eb1fc03e435607783fa1b29614
Contents?: true
Size: 332 Bytes
Versions: 12
Compression:
Stored size: 332 Bytes
Contents
class TaxCalculator def initialize(order) @order = order end # Returns tax amount in float def tax amount = BigDecimal(@order.line_items_total.to_s) (amount * BigDecimal(tax_percentage.to_s) * BigDecimal.new("0.01")).round(2).to_f end private def tax_percentage Shop.first.tax_percentage end end
Version data entries
12 entries across 12 versions & 1 rubygems