Sha256: fcc3d0771473dc7a1ab167a977a403f05c9b24eaa0075d9f405721146383cef9
Contents?: true
Size: 454 Bytes
Versions: 17
Compression:
Stored size: 454 Bytes
Contents
module TaxJp module ConsumptionTax @@consumption_taxes = TaxJp::Utils.load_yaml('消費税.yml') def rate_on(date, options = {}) if date.is_a?(String) date = Date.parse(date) end ret = 0 @@consumption_taxes.reverse_each do |start_date, rate| ret = rate['total'] break if date >= start_date end if options[:percent] ret *= 100 end ret end end end
Version data entries
17 entries across 17 versions & 1 rubygems