Sha256: 903e134195b103721faecf4ba888391d8939906c6e22972f09fbdb1fae8b21ba

Contents?: true

Size: 797 Bytes

Versions: 33

Compression:

Stored size: 797 Bytes

Contents

module Xsys
  module Model
    class CompanyTaxCalculation
      def self.attr_list
        [
          :company_code,
          :company_name,
          :tax_retention_rate,
          :tax_retention_amount,
          :tax_perception_rate,
          :tax_perception_amount
        ]
      end

      attr_reader *attr_list

      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

      private

      attr_writer *attr_list
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
xsys-0.25.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.24.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.23.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.22.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.21.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.20.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.19.2 lib/xsys/model/company_tax_calculation.rb
xsys-0.19.1 lib/xsys/model/company_tax_calculation.rb
xsys-0.19.0 lib/xsys/model/company_tax_calculation.rb
xsys-0.18 lib/xsys/model/company_tax_calculation.rb
xsys-0.17.2 lib/xsys/model/company_tax_calculation.rb
xsys-0.17.1 lib/xsys/model/company_tax_calculation.rb
xsys-0.17.0 lib/xsys/model/company_tax_calculation.rb