Sha256: b42414a77b762161ba8d385eba417eb9509272d0f563a14b62bb8babf07e186a

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

require 'creditsafe/base_model'
require 'creditsafe/models/basic_information'
require 'creditsafe/models/activity_classification'

module Creditsafe
  module Models
    class CompanyIdentification < BaseModel
      attributes :basic_information, :activity_classifications

      def self.build(json:)
        super.tap do |record|
          record.basic_information = BasicInformation.build(json: json.fetch(:basicInformation, {}))
          record.activity_classifications = json.fetch(:activityClassifications, [])
                                            .map { |ac| ActivityClassification.build(json: ac) }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
creditsafe_connect-0.1.2 lib/creditsafe/models/company_identification.rb
creditsafe_connect-0.1.1 lib/creditsafe/models/company_identification.rb
creditsafe_connect-0.1.0 lib/creditsafe/models/company_identification.rb