Sha256: 46fe4e7d1c6e837e0abf4e223dfe4142b2eca064567da0d2470edab434d1c6d7

Contents?: true

Size: 516 Bytes

Versions: 3

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

require 'credit_gateway/base_model'
require 'credit_gateway/rating'
require 'credit_gateway/rating_status'

module CreditGateway
  class RatingComponent < BaseModel
    attributes :type, :ids, :rating, :confidence, :algorithm, :optional, :status, :additional_data

    def self.build(json:)
      super.tap do |record|
        record.status = RatingStatus.build(json: (record.status || {}))
        record.rating = Rating.build(json: (record.rating || {}))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
credit_gateway-0.3.2 lib/credit_gateway/rating_component.rb
credit_gateway-0.3.1 lib/credit_gateway/rating_component.rb
credit_gateway-0.3.0 lib/credit_gateway/rating_component.rb