# 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