Sha256: c831985f46216978cbbd006f5785d5235349c5a645a91ca8a97de5414626db78

Contents?: true

Size: 493 Bytes

Versions: 14

Compression:

Stored size: 493 Bytes

Contents

module Xsys
  module Model
    class Corporation
      def self.attr_list
        [:cuit, :name, :taxes]
      end

      attr_reader *attr_list

      def initialize(attributes={})
        attributes.each do |k, v|
          if k.to_s == 'taxes'
            self.taxes = v.map { |x| CorporationTax.new(x) } 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

14 entries across 14 versions & 1 rubygems

Version Path
xsys-0.47.0 lib/xsys/model/corporation.rb
xsys-0.46.0 lib/xsys/model/corporation.rb
xsys-0.45.0 lib/xsys/model/corporation.rb
xsys-0.44.0 lib/xsys/model/corporation.rb
xsys-0.43.0 lib/xsys/model/corporation.rb
xsys-0.42.0 lib/xsys/model/corporation.rb
xsys-0.41.0 lib/xsys/model/corporation.rb
xsys-0.40.0 lib/xsys/model/corporation.rb
xsys-0.39.0 lib/xsys/model/corporation.rb
xsys-0.38.0 lib/xsys/model/corporation.rb
xsys-0.37.0 lib/xsys/model/corporation.rb
xsys-0.36.0 lib/xsys/model/corporation.rb
xsys-0.35.0 lib/xsys/model/corporation.rb
xsys-0.34.0 lib/xsys/model/corporation.rb