class Panier::Domain::TaxClass
A tax class is a value object that describes a particular type of tax or duty applicable to products sold.
Attributes
name[R]
rate[R]
Public Class Methods
new(name, rate)
click to toggle source
Initializes the tax class using the given name and rate.
@param name [String] A display name for the tax class. @param rate [Float] The rate of tax, where 0.1 would represent 10% tax.
# File lib/panier/domain/tax_class.rb, line 15 def initialize(name, rate) @name = name self.rate = rate end
Protected Instance Methods
rate=(rate)
click to toggle source
# File lib/panier/domain/tax_class.rb, line 22 def rate=(rate) fail ArgumentError, ':rate must be non-negative' if rate < 0 @rate = rate end