Sha256: 072c3b404906155357f08fa45011313e2abef235afde3d9305bfe6a7495e7b19
Contents?: true
Size: 535 Bytes
Versions: 6
Compression:
Stored size: 535 Bytes
Contents
module AlfaInsurance class CreateResponse < CalculateResponse def insurance_id body[:policy_id].to_i end def cost Money.from_amount(body.dig(:calculation_result, :premium).to_f, currency) end def risk_value Money.from_amount(body.dig(:calculation_result, :risk_value_sum).to_f, currency) end def risk_type body.dig(:calculation_result, :risk_value, :@risk_type) end private def currency @currency ||= body.dig(:calculation_result, :currency) end end end
Version data entries
6 entries across 6 versions & 1 rubygems