Class: Xsys::Model::CompanyTaxCalculation
- Inherits:
-
Object
- Object
- Xsys::Model::CompanyTaxCalculation
- Defined in:
- lib/xsys/model/company_tax_calculation.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CompanyTaxCalculation
constructor
A new instance of CompanyTaxCalculation.
Constructor Details
#initialize(attributes = {}) ⇒ CompanyTaxCalculation
Returns a new instance of CompanyTaxCalculation.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/xsys/model/company_tax_calculation.rb', line 17 def initialize(attributes={}) attributes.each do |k, v| decimal_fields = ['tax_retention_rate', 'tax_retention_amount', 'tax_perception_rate', 'tax_perception_amount'] if decimal_fields.include?(k.to_s) self.send("#{k}=", BigDecimal.new(v)) unless v.nil? else self.send("#{k}=", v) if self.respond_to?(k) end end end |
Class Method Details
.attr_list ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/xsys/model/company_tax_calculation.rb', line 4 def self.attr_list [ :company_code, :company_name, :tax_retention_rate, :tax_retention_amount, :tax_perception_rate, :tax_perception_amount ] end |