class Creditsafe::Models::CreditScore

Public Class Methods

build(json:) click to toggle source
Calls superclass method Creditsafe::BaseModel::build
# File lib/creditsafe/models/credit_score.rb, line 13
def self.build(json:)
  super.tap do |record|
    record.current_credit_rating = CreditRating.build(json: json.fetch(:currentCreditRating, {}))
    record.current_contract_limit = CurrencyValue.build(json: json.fetch(:currentContractLimit, {}))
    record.previous_credit_rating = CreditRating.build(json: json.fetch(:previousCreditRating, {}))
  end
end