Sha256: d4587c78f1e2d3b19a9bbef7d26054b408f8cbca9ff1f2910b4118948dc4d927

Contents?: true

Size: 423 Bytes

Versions: 8

Compression:

Stored size: 423 Bytes

Contents

# frozen_string_literal: true

require 'creditsafe/base_model'
require 'creditsafe/models/activity'

module Creditsafe
  module Models
    class ActivityClassification < BaseModel
      attributes :classification, :activities

      def self.build(json:)
        super.tap do |record|
          record.activities = json.fetch(:activities, []).map { |act| Activity.build(json: act) }
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
creditsafe_connect-0.1.7 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.6 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.5 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.4 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.3 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.2 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.1 lib/creditsafe/models/activity_classification.rb
creditsafe_connect-0.1.0 lib/creditsafe/models/activity_classification.rb